Skip to content

Commit 581bb31

Browse files
authored
Merge pull request #33 from codebytes/updates
Updates
2 parents 51c548c + 1a9e933 commit 581bb31

File tree

423 files changed

+1081
-3456
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

423 files changed

+1081
-3456
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net9.0</TargetFramework>
5+
<TargetFramework>net10.0</TargetFramework>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88
</PropertyGroup>

01-basic-console/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
## Overview
2+
3+
- Baseline .NET console sample with top-level statements.
4+
- Use as the control before layering configuration providers.
5+
6+
## Run
7+
8+
```powershell
9+
dotnet run --project 01-basic-console/BasicConsole.csproj
10+
```

01-generic-host/Program.cs

Lines changed: 0 additions & 7 deletions
This file was deleted.

01-generic-host/README.md

Lines changed: 0 additions & 14 deletions
This file was deleted.

02-basic-console/README.md

Lines changed: 0 additions & 15 deletions
This file was deleted.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net9.0</TargetFramework>
5+
<TargetFramework>net10.0</TargetFramework>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.8" />
11+
<PackageReference Include="Microsoft.Extensions.Hosting" Version="10.0.0" />
1212
</ItemGroup>
1313

1414
</Project>

02-generic-host/Program.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using Microsoft.Extensions.Hosting;
2+
3+
var builder = Host.CreateApplicationBuilder(args);
4+
var configuration = builder.Configuration;
5+
6+
using IHost host = builder.Build();
7+
8+
// Application code should start here.
9+
Console.WriteLine("Hello, World!");
10+
Console.WriteLine($"{configuration["greeting"]}, {configuration["environment"]}!");
11+
await host.RunAsync();

02-generic-host/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
## Overview
2+
3+
- Shows Host.CreateApplicationBuilder scaffolding for configuration, logging, and DI.
4+
- Demonstrates long-running host lifetime versus a simple console exit.
5+
6+
## Run
7+
8+
```powershell
9+
dotnet run --project 02-generic-host/GenericHost.csproj
10+
```
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@
33
"KeyTwo": true,
44
"KeyThree": {
55
"Message": "Thanks for checking this out!"
6-
}
6+
},
7+
"greeting": "Hello",
8+
"environment": "dev"
79
}

0 commit comments

Comments
 (0)