5cf5f888eb
- ServiceCollectionExtensions in DAL.EF: AddNotificationDataAccess (DbContext, UoW, repositories) - ServiceCollectionExtensions in Services: AddNotificationServices (MediatR + TransactionBehavior) - Api/Program.cs: Serilog, OpenAPI, controllers, DI wiring - Worker/Program.cs: Serilog, DI wiring - appsettings.json: Serilog config with Console + Seq sinks, connection string - appsettings.Development.json: Debug log level overrides Ref: IT-628 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
26 lines
743 B
C#
26 lines
743 B
C#
using HrynCo.NotificationService.DAL.EF;
|
|
using HrynCo.NotificationService.Services;
|
|
using Serilog;
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
builder.Host.UseSerilog((context, lc) =>
|
|
lc.ReadFrom.Configuration(context.Configuration));
|
|
|
|
builder.Services.AddOpenApi();
|
|
builder.Services.AddControllers();
|
|
|
|
string connectionString = builder.Configuration.GetConnectionString("Default")
|
|
?? throw new InvalidOperationException("Connection string 'Default' is not configured.");
|
|
|
|
builder.Services.AddNotificationDataAccess(connectionString);
|
|
builder.Services.AddNotificationServices();
|
|
|
|
var app = builder.Build();
|
|
|
|
if (app.Environment.IsDevelopment())
|
|
app.MapOpenApi();
|
|
|
|
app.UseHttpsRedirection();
|
|
app.MapControllers();
|
|
app.Run(); |