project base (minimum web api with ef)

main
Peace 11 months ago
parent aa944022e1
commit 7e24dbc845
  1. 6
      AspNetCoreLearnOfficial.sln
  2. 14
      MinimumWebAPIWithEF/MinimumWebAPIWithEF.csproj
  3. 6
      MinimumWebAPIWithEF/MinimumWebAPIWithEF.http
  4. 21
      MinimumWebAPIWithEF/Program.cs
  5. 41
      MinimumWebAPIWithEF/Properties/launchSettings.json
  6. 8
      MinimumWebAPIWithEF/appsettings.Development.json
  7. 9
      MinimumWebAPIWithEF/appsettings.json

@ -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

@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.5" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
</ItemGroup>
</Project>

@ -0,0 +1,6 @@
@MinimumWebAPIWithEF_HostAddress = http://localhost:5034
GET {{MinimumWebAPIWithEF_HostAddress}}/weatherforecast/
Accept: application/json
###

@ -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();

@ -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"
}
}
}
}

@ -0,0 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}

@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}
Loading…
Cancel
Save