#region ========================================================================= USING ===================================================================================== using FluentValidation; using Lumina.Application.Common.Infrastructure.Authentication; using Lumina.Application.Common.Infrastructure.Authorization.Policies.Over18; using Lumina.Application.Common.Infrastructure.Security; using Lumina.Application.Common.Infrastructure.Time; using Lumina.Infrastructure.Core.Authentication; using Lumina.Infrastructure.Core.Authorization.Policies.Common.Factory; using Lumina.Infrastructure.Core.Authorization.Policies.Over18; using Lumina.Infrastructure.Core.Security; using Lumina.Infrastructure.Core.Time; using Microsoft.Extensions.DependencyInjection; using System.Diagnostics.CodeAnalysis; using System.Reflection; #endregion namespace Lumina.Infrastructure.Common.DependencyInjection; /// /// Contains all services of the Infrastructure layer. /// [ExcludeFromCodeCoverage] public static class InfrastructureLayerServices { /// /// Extension method for adding the Infrastructure layer services to the DI container. /// /// The service collection to add the services to. /// The updated . public static IServiceCollection AddInfrastructureLayerServices(this IServiceCollection services) { // scan the current assembly for validators and add them to the DI container services.AddValidatorsFromAssembly(Assembly.GetExecutingAssembly(), ServiceLifetime.Singleton); services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); // authorization services.AddScoped(); services.AddScoped(); return services; } }