| | 1 | | using FLP.Application.Handlers.Exceptions; |
| | 2 | | using MediatR.Pipeline; |
| | 3 | | using Microsoft.Extensions.DependencyInjection; |
| | 4 | |
|
| | 5 | | namespace FLP.Application.Configurations; |
| | 6 | |
|
| | 7 | | public static class ApplicationConfigurationExtension |
| | 8 | | { |
| | 9 | | /// <summary> |
| | 10 | | /// Configures the application services for the application. |
| | 11 | | /// </summary> |
| | 12 | | /// <param name="services">The service collection to configure.</param> |
| | 13 | | public static void AddApplicationServices(this IServiceCollection services) |
| 0 | 14 | | { |
| | 15 | | // Register application services here |
| | 16 | | // Example: services.AddScoped<IMyService, MyService>(); |
| | 17 | | // Add other application-specific configurations as needed |
| | 18 | | //services.AddMediatR(cfg => cfg.RegisterServicesFromAssembly(typeof(ApplicationConfigurationExtension).Assembly |
| 0 | 19 | | services.AddMediatR(cfg => cfg.RegisterServicesFromAssemblyContaining<ApplicationConfiguration>()); |
| 0 | 20 | | services.AddTransient(typeof(IRequestExceptionHandler<,,>), typeof(GlobalRequestExceptionHandler<,,>)); |
| | 21 | |
|
| 0 | 22 | | services.AddAutoMapper(typeof(ApplicationConfiguration).Assembly); |
| | 23 | |
|
| 0 | 24 | | } |
| | 25 | | } |