You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.1 KiB

using Easy.Extensions;
using Easy.Options;
using TenantManagement.Api.Realization;
namespace TenantManagement.Api;
public static class ProgramExtension
{
public static WebApplication ConfigureServices(this WebApplicationBuilder builder)
{
builder.AddCustomDbContext();
builder.AddCustomAuthentication();
builder.Services.AddDynamicWebApi();
builder.Services.AddDependency();
builder.Services.AddUow();
builder.Services.AddRepositories();
builder.Services.AddDomainServices();
builder.Services.AddApiResultProxy();
builder.Services.AddAutoMapper(AppDomain.CurrentDomain.GetAssemblies());
builder.Services.AddSwaggerGen();
builder.Services.AddHttpContextAccessor();
return builder.Build();
}
public static WebApplication ConfigurePipeline(this WebApplication app)
{
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
app.MapControllers();
return app;
}
}