init: initial commit

This commit is contained in:
2025-11-22 16:55:24 +03:30
commit 4afb545253
194 changed files with 94247 additions and 0 deletions
+51
View File
@@ -0,0 +1,51 @@
using Application.Aggregates.Users;
using Domain.Aggregates.Users.Data;
using Microsoft.EntityFrameworkCore;
using Persistence;
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<DatabaseContext>(opt =>
{
opt.UseSqlite("Data Source=../../../db/database.db");
});
// Add DI's
builder.Services.AddScoped<IUserRepository, UserRepository>();
builder.Services.AddScoped<UsersApplication>();
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();
}
}