Skip to content

Instantly share code, notes, and snippets.

@luisdeol
Created May 4, 2021 13:09
Show Gist options
  • Save luisdeol/efc673966e55cff4d538ad2170344244 to your computer and use it in GitHub Desktop.
Save luisdeol/efc673966e55cff4d538ad2170344244 to your computer and use it in GitHub Desktop.
Artigo Boas Práticas - Aplicação e Infraestrutura
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