Created
May 4, 2021 13:09
-
-
Save luisdeol/efc673966e55cff4d538ad2170344244 to your computer and use it in GitHub Desktop.
Artigo Boas Práticas - Aplicação e Infraestrutura
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class ServiceCollectionExtensions | |
{ | |
public static IServiceCollection AddInfrastructure(this IServiceCollection services) | |
{ | |
services.AddScoped<IEmployeeRepository, EmployeeRepository>(); | |
services.AddScoped<ICustomerRepository, CustomerRepository>(); | |
services.AddScoped<IProductRepository, ProductRepository>(); | |
services.AddScoped<IOrderRepository, OrderRepository>(); | |
services.AddScoped<IOrderInvoiceRepository, OrderInvoiceRepository>(); | |
services.AddScoped<IOrderDeliveryRepository, OrderDeliveryRepository>(); | |
services.AddScoped<ILoyaltyProgramRepository, LoyaltyProgramRepository>(); | |
services.AddScoped<IProductCategoryRepository, ProductCategoryRepository>(); | |
services.AddScoped<IErpIntegrationService, ErpIntegrationService>(); | |
services.AddScoped<IMessageBusService, AzureServiceBusService>(); | |
services.AddScoped<IFileStorageService, AzureFileStorageService>(); | |
services.AddScoped<IMapService, AzureMapService>(); | |
return services; | |
} | |
public static IServiceCollection AddApplication(this IServiceCollection services) | |
{ | |
services.AddScoped<IEmployeeService, EmployeeService>(); | |
services.AddScoped<ICustomerService, CustomerService>(); | |
services.AddScoped<IProductService, ProductService>(); | |
services.AddScoped<IOrderService, OrderService>(); | |
services.AddScoped<IOrderInvoiceService, OrderInvoiceService>(); | |
services.AddScoped<IOrderDeliveryService, OrderDeliveryService>(); | |
services.AddScoped<ILoyaltyProgramService, LoyaltyProgramService>(); | |
services.AddScoped<IProductCategoryService, ProductCategoryService>(); | |
return services; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment