WorkFlowCheck.Web hozzáadása
This commit is contained in:
@@ -1,24 +1,16 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Serilog;
|
||||
using WorkFlowCheck.BL.Infra;
|
||||
using WorkFlowCheck.BL.Mappings;
|
||||
using WorkFlowCheck.DL;
|
||||
using WorkFlowCheck.DL.Seed;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
Log.Logger = new LoggerConfiguration()
|
||||
.ReadFrom.Configuration(builder.Configuration)
|
||||
.CreateLogger();
|
||||
builder.Services.AddAutoMapper(typeof(MapperProfile));
|
||||
|
||||
builder.Services.AddMemoryCache();
|
||||
builder.Services.AddHttpContextAccessor();
|
||||
|
||||
var connectionString = builder.Configuration.GetConnectionString("DefaultConnection");
|
||||
builder.Services.AddDbContext<AppDbContext>(options =>
|
||||
options.UseSqlServer(connectionString, x => x.MigrationsAssembly("WorkFlowCheck.DL")));
|
||||
//DI
|
||||
|
||||
DIConfig.DIInit(builder.Services);
|
||||
|
||||
|
||||
|
||||
builder.Host.UseSerilog();
|
||||
// Add services to the container.
|
||||
@@ -26,11 +18,7 @@ builder.Services.AddRazorPages();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
using (var scope = app.Services.CreateScope())
|
||||
{
|
||||
var context = scope.ServiceProvider.GetRequiredService<AppDbContext>();
|
||||
DBInitializer.Seed(context);
|
||||
}
|
||||
|
||||
// Configure the HTTP request pipeline.
|
||||
if (!app.Environment.IsDevelopment())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user