Skip to content

Instantly share code, notes, and snippets.

@luisdeol
Last active May 4, 2021 13:14
Show Gist options
  • Save luisdeol/ad55934a2528815f03da9663885ce516 to your computer and use it in GitHub Desktop.
Save luisdeol/ad55934a2528815f03da9663885ce516 to your computer and use it in GitHub Desktop.
Artigo Boas Práticas - Startup.ConfigureServices ANTES
public void ConfigureServices(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>();
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>();
services.AddControllers();
services.AddSwaggerGen(c =>
{
c.SwaggerDoc("v1", new OpenApiInfo { Title = "ArtigoBoasPraticas.API", Version = "v1" });
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment