Небольшие фиксы
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@ -491,3 +491,5 @@ fabric.properties
|
|||||||
# Android studio 3.1+ serialized cache file
|
# Android studio 3.1+ serialized cache file
|
||||||
.idea/caches/build_file_checksums.ser
|
.idea/caches/build_file_checksums.ser
|
||||||
|
|
||||||
|
|
||||||
|
HackathonPreparing/.idea/.idea.HackathonPreparing/.idea/
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
using System.Diagnostics;
|
|
||||||
using HackathonPreparing.ApiService;
|
using HackathonPreparing.ApiService;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.OpenApi.Models;
|
using Microsoft.OpenApi.Models;
|
||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
|
||||||
|
|
||||||
builder.Services.AddEndpointsApiExplorer();
|
builder.Services.AddEndpointsApiExplorer();
|
||||||
builder.Services.AddSwaggerGen(c =>
|
builder.Services.AddSwaggerGen(c =>
|
||||||
{
|
{
|
||||||
@ -21,21 +19,14 @@ builder.AddServiceDefaults();
|
|||||||
// Add services to the container.
|
// Add services to the container.
|
||||||
builder.Services.AddProblemDetails();
|
builder.Services.AddProblemDetails();
|
||||||
|
|
||||||
|
|
||||||
builder.AddNpgsqlDbContext<DatabaseContext>("prod", null,
|
builder.AddNpgsqlDbContext<DatabaseContext>("prod", null,
|
||||||
optionsBuilder => optionsBuilder.UseNpgsql(npgsqlBuilder =>
|
optionsBuilder => optionsBuilder.UseNpgsql(npgsqlBuilder =>
|
||||||
npgsqlBuilder.MigrationsAssembly(typeof(Program).Assembly.GetName().Name)));
|
npgsqlBuilder.MigrationsAssembly(typeof(Program).Assembly.GetName().Name)));
|
||||||
|
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
|
|
||||||
|
|
||||||
var logger = app.Services.GetRequiredService<ILogger<Program>>();
|
var logger = app.Services.GetRequiredService<ILogger<Program>>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (app.Environment.IsDevelopment())
|
if (app.Environment.IsDevelopment())
|
||||||
{
|
{
|
||||||
logger.LogWarning("!!!!!!! Call /ensure-created enpoint or /migrate if no db !!!!!!!!");
|
logger.LogWarning("!!!!!!! Call /ensure-created enpoint or /migrate if no db !!!!!!!!");
|
||||||
@ -52,9 +43,6 @@ if (app.Environment.IsDevelopment())
|
|||||||
// Configure the HTTP request pipeline.
|
// Configure the HTTP request pipeline.
|
||||||
app.UseExceptionHandler();
|
app.UseExceptionHandler();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
app.MapGet("/weatherforecast", async (DatabaseContext db) => await db.Forecasts.ToListAsync());
|
app.MapGet("/weatherforecast", async (DatabaseContext db) => await db.Forecasts.ToListAsync());
|
||||||
|
|
||||||
app.MapDefaultEndpoints();
|
app.MapDefaultEndpoints();
|
||||||
|
@ -1,43 +0,0 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
|
||||||
# Visual Studio Version 17
|
|
||||||
VisualStudioVersion = 17.5.002.0
|
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HackathonPreparing.ApiService", "HackathonPreparing.ApiService\HackathonPreparing.ApiService.csproj", "{DF197643-F98E-43D0-8C93-78C27D11CB26}"
|
|
||||||
EndProject
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HackathonPreparing.AppHost", "HackathonPreparing.AppHost\HackathonPreparing.AppHost.csproj", "{DD3AB30E-1CB0-4E60-B513-7BBA4A0EA7B0}"
|
|
||||||
EndProject
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HackathonPreparing.ServiceDefaults", "HackathonPreparing.ServiceDefaults\HackathonPreparing.ServiceDefaults.csproj", "{29EC9110-27F1-45F9-A351-8EF6A12A1D5C}"
|
|
||||||
EndProject
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HackathonPreparing.Web", "HackathonPreparing.Web\HackathonPreparing.Web.csproj", "{164763E8-DED7-4C3C-8F36-095CB4F863C7}"
|
|
||||||
EndProject
|
|
||||||
Global
|
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
|
||||||
Debug|Any CPU = Debug|Any CPU
|
|
||||||
Release|Any CPU = Release|Any CPU
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
|
||||||
{DF197643-F98E-43D0-8C93-78C27D11CB26}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{DF197643-F98E-43D0-8C93-78C27D11CB26}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{DF197643-F98E-43D0-8C93-78C27D11CB26}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{DF197643-F98E-43D0-8C93-78C27D11CB26}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{DD3AB30E-1CB0-4E60-B513-7BBA4A0EA7B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{DD3AB30E-1CB0-4E60-B513-7BBA4A0EA7B0}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{DD3AB30E-1CB0-4E60-B513-7BBA4A0EA7B0}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{DD3AB30E-1CB0-4E60-B513-7BBA4A0EA7B0}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{29EC9110-27F1-45F9-A351-8EF6A12A1D5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{29EC9110-27F1-45F9-A351-8EF6A12A1D5C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{29EC9110-27F1-45F9-A351-8EF6A12A1D5C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{29EC9110-27F1-45F9-A351-8EF6A12A1D5C}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{164763E8-DED7-4C3C-8F36-095CB4F863C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{164763E8-DED7-4C3C-8F36-095CB4F863C7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{164763E8-DED7-4C3C-8F36-095CB4F863C7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{164763E8-DED7-4C3C-8F36-095CB4F863C7}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
|
||||||
HideSolutionNode = FALSE
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
|
||||||
SolutionGuid = {80C5F09A-371B-4BC1-9514-36F72E4A64F9}
|
|
||||||
EndGlobalSection
|
|
||||||
EndGlobal
|
|
Reference in New Issue
Block a user