2024-02-09 00:29:56 +00:00
|
|
|
using Microsoft.EntityFrameworkCore;
|
2024-06-03 19:44:25 +00:00
|
|
|
using Api.Models;
|
2024-02-09 00:29:56 +00:00
|
|
|
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
|
|
|
|
builder.Services.AddControllers();
|
2024-06-03 19:44:25 +00:00
|
|
|
builder.Services.AddDbContext<Context>(opt =>
|
|
|
|
opt.UseInMemoryDatabase("List"));
|
2024-02-09 00:29:56 +00:00
|
|
|
|
|
|
|
var app = builder.Build();
|
|
|
|
|
|
|
|
if (builder.Environment.IsDevelopment())
|
|
|
|
{
|
|
|
|
app.UseDeveloperExceptionPage();
|
|
|
|
}
|
|
|
|
|
|
|
|
app.UseDefaultFiles();
|
|
|
|
app.UseStaticFiles();
|
|
|
|
|
|
|
|
app.UseHttpsRedirection();
|
|
|
|
|
|
|
|
app.UseAuthorization();
|
|
|
|
|
|
|
|
app.MapControllers();
|
|
|
|
|
|
|
|
app.Run();
|