diff --git a/AspNetCoreLearnOfficial.sln b/AspNetCoreLearnOfficial.sln index e08c6e4..c5b74ac 100644 --- a/AspNetCoreLearnOfficial.sln +++ b/AspNetCoreLearnOfficial.sln @@ -7,6 +7,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebApi", "WebApi\WebApi.csp EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PizzaStore", "MinimumWebAPI\PizzaStore.csproj", "{01E3A866-5135-403E-9059-42EAC85586BC}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MinimumWebAPIWithEF", "MinimumWebAPIWithEF\MinimumWebAPIWithEF.csproj", "{C0C7BBD5-614F-4FE6-B007-412A09B675F8}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -21,6 +23,10 @@ Global {01E3A866-5135-403E-9059-42EAC85586BC}.Debug|Any CPU.Build.0 = Debug|Any CPU {01E3A866-5135-403E-9059-42EAC85586BC}.Release|Any CPU.ActiveCfg = Release|Any CPU {01E3A866-5135-403E-9059-42EAC85586BC}.Release|Any CPU.Build.0 = Release|Any CPU + {C0C7BBD5-614F-4FE6-B007-412A09B675F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C0C7BBD5-614F-4FE6-B007-412A09B675F8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C0C7BBD5-614F-4FE6-B007-412A09B675F8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C0C7BBD5-614F-4FE6-B007-412A09B675F8}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/MinimumWebAPIWithEF/MinimumWebAPIWithEF.csproj b/MinimumWebAPIWithEF/MinimumWebAPIWithEF.csproj new file mode 100644 index 0000000..f8a132c --- /dev/null +++ b/MinimumWebAPIWithEF/MinimumWebAPIWithEF.csproj @@ -0,0 +1,14 @@ + + + + net8.0 + enable + enable + + + + + + + + diff --git a/MinimumWebAPIWithEF/MinimumWebAPIWithEF.http b/MinimumWebAPIWithEF/MinimumWebAPIWithEF.http new file mode 100644 index 0000000..73cf4b5 --- /dev/null +++ b/MinimumWebAPIWithEF/MinimumWebAPIWithEF.http @@ -0,0 +1,6 @@ +@MinimumWebAPIWithEF_HostAddress = http://localhost:5034 + +GET {{MinimumWebAPIWithEF_HostAddress}}/weatherforecast/ +Accept: application/json + +### diff --git a/MinimumWebAPIWithEF/Program.cs b/MinimumWebAPIWithEF/Program.cs new file mode 100644 index 0000000..d7e36c0 --- /dev/null +++ b/MinimumWebAPIWithEF/Program.cs @@ -0,0 +1,21 @@ +var builder = WebApplication.CreateBuilder(args); + +// Add services to the container. +// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle +builder.Services.AddEndpointsApiExplorer(); +builder.Services.AddSwaggerGen(); + +var app = builder.Build(); + +// Configure the HTTP request pipeline. +if (app.Environment.IsDevelopment()) +{ + app.UseSwagger(); + app.UseSwaggerUI(); +} + +app.UseHttpsRedirection(); + + + +app.Run(); diff --git a/MinimumWebAPIWithEF/Properties/launchSettings.json b/MinimumWebAPIWithEF/Properties/launchSettings.json new file mode 100644 index 0000000..0e631a7 --- /dev/null +++ b/MinimumWebAPIWithEF/Properties/launchSettings.json @@ -0,0 +1,41 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:46277", + "sslPort": 44314 + } + }, + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "http://localhost:5034", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "https://localhost:7063;http://localhost:5034", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/MinimumWebAPIWithEF/appsettings.Development.json b/MinimumWebAPIWithEF/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/MinimumWebAPIWithEF/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/MinimumWebAPIWithEF/appsettings.json b/MinimumWebAPIWithEF/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/MinimumWebAPIWithEF/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +}