Skip to content

Commit d632c7e

Browse files
Scaffold the code structure for S04E04
1 parent 9498c1a commit d632c7e

File tree

7 files changed

+83
-0
lines changed

7 files changed

+83
-0
lines changed

dotnet/AI_devs3_Zadania.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "S03E05", "S03E05\S03E05.csp
3535
EndProject
3636
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "S04E02", "S04E02\S04E02.csproj", "{35D7CB4B-3290-4806-A61F-0E9B4A207DA2}"
3737
EndProject
38+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "S04E04", "S04E04\S04E04.csproj", "{BD27A459-11EF-4938-890F-FD2D7B523A85}"
39+
EndProject
3840
Global
3941
GlobalSection(SolutionConfigurationPlatforms) = preSolution
4042
Debug|Any CPU = Debug|Any CPU
@@ -108,5 +110,9 @@ Global
108110
{35D7CB4B-3290-4806-A61F-0E9B4A207DA2}.Debug|Any CPU.Build.0 = Debug|Any CPU
109111
{35D7CB4B-3290-4806-A61F-0E9B4A207DA2}.Release|Any CPU.ActiveCfg = Release|Any CPU
110112
{35D7CB4B-3290-4806-A61F-0E9B4A207DA2}.Release|Any CPU.Build.0 = Release|Any CPU
113+
{BD27A459-11EF-4938-890F-FD2D7B523A85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
114+
{BD27A459-11EF-4938-890F-FD2D7B523A85}.Debug|Any CPU.Build.0 = Debug|Any CPU
115+
{BD27A459-11EF-4938-890F-FD2D7B523A85}.Release|Any CPU.ActiveCfg = Release|Any CPU
116+
{BD27A459-11EF-4938-890F-FD2D7B523A85}.Release|Any CPU.Build.0 = Release|Any CPU
111117
EndGlobalSection
112118
EndGlobal

dotnet/S04E04/GlobalUsings.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
global using System.Text.Json;
2+
global using System.Text.Json.Serialization;
3+
global using Microsoft.Extensions.DependencyInjection;
4+
global using Microsoft.Extensions.Hosting;
5+
global using Microsoft.Extensions.Options;

dotnet/S04E04/Program.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using S04E04;
2+
3+
var builder = WebApplication.CreateBuilder(args);
4+
builder.Services.AddS04E04Services();
5+
var app = builder.Build();
6+
7+
app.MapGet("/", () => "Hello World!");
8+
9+
await app.RunAsync();
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"$schema": "https://json.schemastore.org/launchsettings.json",
3+
"profiles": {
4+
"http": {
5+
"commandName": "Project",
6+
"dotnetRunMessages": true,
7+
"launchBrowser": true,
8+
"applicationUrl": "http://localhost:5282",
9+
"environmentVariables": {
10+
"ASPNETCORE_ENVIRONMENT": "Development"
11+
}
12+
},
13+
"https": {
14+
"commandName": "Project",
15+
"dotnetRunMessages": true,
16+
"launchBrowser": true,
17+
"applicationUrl": "https://localhost:7229;http://localhost:5282",
18+
"environmentVariables": {
19+
"ASPNETCORE_ENVIRONMENT": "Development"
20+
}
21+
}
22+
}
23+
}

dotnet/S04E04/S04E04.csproj

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
<PropertyGroup>
3+
<TargetFramework>net9.0</TargetFramework>
4+
<Nullable>enable</Nullable>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<UserSecretsId>ai-devs3</UserSecretsId>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<ProjectReference Include="..\Common\Common.csproj" />
11+
</ItemGroup>
12+
13+
<ItemGroup>
14+
<None Update="appsettings.json">
15+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
16+
</None>
17+
</ItemGroup>
18+
</Project>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using Common.AiDevsApi.Extensions;
2+
3+
namespace S04E04;
4+
5+
public static class ServiceCollectionExtensions
6+
{
7+
public static IServiceCollection AddS04E04Services(this IServiceCollection services)
8+
{
9+
10+
return services
11+
.AddAiDevsApi();
12+
}
13+
}

dotnet/S04E04/appsettings.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Information",
5+
"Microsoft.AspNetCore": "Warning"
6+
}
7+
},
8+
"AllowedHosts": "*"
9+
}

0 commit comments

Comments
 (0)