WebApi + ClientApp, GraphQL, Reflection
This commit is contained in:
32
Events-WebApi/Events.FilesAPI/Program.cs
Normal file
32
Events-WebApi/Events.FilesAPI/Program.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using Events.FilesAPI.Features.Certificates;
|
||||
using Events.FilesAPI.Features.RegistrationsExcel;
|
||||
using Events.FilesAPI.Infrastructure.Messaging;
|
||||
using Events.FilesAPI.Infrastructure.Options;
|
||||
using Events.WebAPI.Handlers.EF.Data.Postgres;
|
||||
using MediatR;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
builder.Services.AddControllers();
|
||||
|
||||
builder.Services.AddDbContext<EventsContext>(options =>
|
||||
options.UseNpgsql(builder.Configuration.GetConnectionString("EventDB")));
|
||||
|
||||
builder.Services.AddOptions<GeneratedFilesOptions>()
|
||||
.Bind(builder.Configuration.GetSection("Paths"))
|
||||
.ValidateDataAnnotations()
|
||||
.Validate(
|
||||
settings => !string.IsNullOrWhiteSpace(settings.OutputPath),
|
||||
"GeneratedFilesOptions:OutputPath must be configured.")
|
||||
.ValidateOnStart();
|
||||
|
||||
builder.Services.AddMediatR(cfg => cfg.RegisterServicesFromAssembly(typeof(Program).Assembly));
|
||||
|
||||
builder.Services.SetupMassTransit(builder.Configuration);
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
app.MapControllers();
|
||||
|
||||
app.Run();
|
||||
Reference in New Issue
Block a user