Небольшие фиксы

This commit is contained in:
2024-06-16 18:04:59 +03:00
parent 739825b4c1
commit 9067d8dece
3 changed files with 2 additions and 55 deletions

2
.gitignore vendored
View File

@ -491,3 +491,5 @@ fabric.properties
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
HackathonPreparing/.idea/.idea.HackathonPreparing/.idea/

View File

@ -1,11 +1,9 @@
using System.Diagnostics;
using HackathonPreparing.ApiService;
using Microsoft.EntityFrameworkCore;
using Microsoft.OpenApi.Models;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen(c =>
{
@ -21,21 +19,14 @@ builder.AddServiceDefaults();
// Add services to the container.
builder.Services.AddProblemDetails();
builder.AddNpgsqlDbContext<DatabaseContext>("prod", null,
optionsBuilder => optionsBuilder.UseNpgsql(npgsqlBuilder =>
npgsqlBuilder.MigrationsAssembly(typeof(Program).Assembly.GetName().Name)));
var app = builder.Build();
var logger = app.Services.GetRequiredService<ILogger<Program>>();
if (app.Environment.IsDevelopment())
{
logger.LogWarning("!!!!!!! Call /ensure-created enpoint or /migrate if no db !!!!!!!!");
@ -52,9 +43,6 @@ if (app.Environment.IsDevelopment())
// Configure the HTTP request pipeline.
app.UseExceptionHandler();
app.MapGet("/weatherforecast", async (DatabaseContext db) => await db.Forecasts.ToListAsync());
app.MapDefaultEndpoints();

View File

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