First table in database

This commit is contained in:
2023-10-23 21:29:19 +02:00
parent 00fd8ded6e
commit 1aa4f0b5f6
16 changed files with 491 additions and 21 deletions

View File

@@ -9,14 +9,11 @@ builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
builder.Services.AddSingleton<IGerbilRepository, InMemGerbilRepository>();
builder.Services.AddDbContext<ApplicationContext>(opts => opts.UseSqlServer(builder.Configuration.GetConnectionString("sqlConnection")));
builder.Services.AddScoped<IGerbilRepository, EFGerbilRepository>();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{