using Application.Aggregates.Stores; using Application.Aggregates.Users; using Domain.Aggregates.Stores.Data; using Domain.Aggregates.Users.Data; using Microsoft.EntityFrameworkCore; using Persistence; using Persistence.Repositories.Aggregates.Stores; using Persistence.Repositories.Aggregates.Users; using Server.Infrastructure.Extensions.ServiceCollections; namespace Server; public class Program { public static void Main(string[] args) { var builder = WebApplication.CreateBuilder(args); builder.Services.AddRazorPages(); // Add Settings builder.AddConfiguration(); // Add Database builder.Services.AddDbContext(opt => { opt.UseSqlite("Data Source=../../../db/database.db"); }); // Add DI's builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); var app = builder.Build(); if (!app.Environment.IsDevelopment()) { app.UseExceptionHandler("/Error"); app.UseHsts(); } app.UseHttpsRedirection(); app.UseRouting(); app.UseAuthorization(); app.MapStaticAssets(); app.MapRazorPages() .WithStaticAssets(); app.Run(); } }