Refactor startup (#412)
* Removing unused folder * Refactoring Startup.cs
This commit is contained in:
21
src/Web/Configuration/ConfigureWebServices.cs
Normal file
21
src/Web/Configuration/ConfigureWebServices.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using MediatR;
|
||||
using Microsoft.eShopWeb.Web.Interfaces;
|
||||
using Microsoft.eShopWeb.Web.Services;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace Microsoft.eShopWeb.Web.Configuration
|
||||
{
|
||||
public static class ConfigureWebServices
|
||||
{
|
||||
public static void Configure(IServiceCollection services, IConfiguration configuration)
|
||||
{
|
||||
services.AddMediatR(typeof(BasketViewModelService).Assembly);
|
||||
services.AddScoped<IBasketViewModelService, BasketViewModelService>();
|
||||
services.AddScoped<CatalogViewModelService>();
|
||||
services.AddScoped<ICatalogItemViewModelService, CatalogItemViewModelService>();
|
||||
services.Configure<CatalogSettings>(configuration);
|
||||
services.AddScoped<ICatalogViewModelService, CachedCatalogViewModelService>();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user