init
This commit is contained in:
31
src/Common/Mccn.Common.Infrastructure/DependencyInjection.cs
Normal file
31
src/Common/Mccn.Common.Infrastructure/DependencyInjection.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using Mccn.Common.Infrastructure.Authentication;
|
||||
using Mccn.Common.Infrastructure.Caching;
|
||||
using Mccn.Common.Infrastructure.ExceptionHandlers;
|
||||
using Mccn.Common.Infrastructure.Observability;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace Mccn.Common.Infrastructure;
|
||||
|
||||
public static class DependencyInjection
|
||||
{
|
||||
public static IServiceCollection AddInfrastructure(
|
||||
this IServiceCollection services,
|
||||
IConfiguration configuration)
|
||||
{
|
||||
services.AddJwtAuthentication(configuration);
|
||||
|
||||
services.AddAuthorization();
|
||||
|
||||
services.AddCaching(configuration);
|
||||
|
||||
services.AddObservability("Mccn", configuration);
|
||||
|
||||
services.AddExceptionHandler<GlobalExceptionHandler>();
|
||||
services.AddProblemDetails();
|
||||
|
||||
services.AddHttpContextAccessor();
|
||||
|
||||
return services;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user