i'm not sure what i'm doing

This commit is contained in:
Вячеслав 2025-03-25 22:56:35 +05:00
parent 950babb68c
commit 35331a87f1
7 changed files with 41 additions and 13 deletions

View file

@ -1,3 +1,8 @@
using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;
using SurveyBackend.Core.Models;
using SurveyBackend.Infrastructure.Data;
namespace SurveyBackend;
public class Program
@ -8,7 +13,16 @@ public class Program
// Add services to the container.
builder.Services.AddAuthorization();
builder.Services.AddDbContext<DataContext>(options =>
{
options.UseSqlite(builder.Configuration.GetConnectionString("DefaultConnection"));
});
builder.Services.AddIdentity<User, IdentityRole<int>>(options => { })
.AddEntityFrameworkStores<DataContext>()
.AddDefaultTokenProviders();
builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
@ -25,9 +39,9 @@ public class Program
}
app.UseAuthorization();
app.MapControllers();
app.Run();
}
}