using CleanArchitecture.Application.Interfaces; using CleanArchitecture.Application.Queries.Tenants.GetAll; using CleanArchitecture.Application.Queries.Tenants.GetTenantById; using CleanArchitecture.Application.Queries.Users.GetAll; using CleanArchitecture.Application.Queries.Users.GetUserById; using CleanArchitecture.Application.Services; using CleanArchitecture.Application.SortProviders; using CleanArchitecture.Application.ViewModels; using CleanArchitecture.Application.ViewModels.Sorting; using CleanArchitecture.Application.ViewModels.Tenants; using CleanArchitecture.Application.ViewModels.Users; using CleanArchitecture.Domain.Entities; using MediatR; using Microsoft.Extensions.DependencyInjection; namespace CleanArchitecture.Application.Extensions; public static class ServiceCollectionExtensions { public static IServiceCollection AddServices(this IServiceCollection services) { services.AddScoped(); services.AddScoped(); return services; } public static IServiceCollection AddQueryHandlers(this IServiceCollection services) { // User services.AddScoped, GetUserByIdQueryHandler>(); services.AddScoped>, GetAllUsersQueryHandler>(); // Tenant services.AddScoped, GetTenantByIdQueryHandler>(); services .AddScoped>, GetAllTenantsQueryHandler>(); return services; } public static IServiceCollection AddSortProviders(this IServiceCollection services) { services.AddScoped, TenantViewModelSortProvider>(); services.AddScoped, UserViewModelSortProvider>(); return services; } }