Created
February 4, 2019 23:00
-
-
Save evgomes/f76d4bd23ebd239a4c938bd970b69932 to your computer and use it in GitHub Desktop.
Last edit of ConfigureServices, from Supermarket API
This file contains 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 void ConfigureServices(IServiceCollection services) | |
{ | |
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2); | |
services.AddDbContext<AppDbContext>(options => | |
{ | |
options.UseInMemoryDatabase("supermarket-api-in-memory"); | |
}); | |
services.AddScoped<ICategoryRepository, CategoryRepository>(); | |
services.AddScoped<IProductRepository, ProductRepository>(); | |
services.AddScoped<IUnitOfWork, UnitOfWork>(); | |
services.AddScoped<ICategoryService, CategoryService>(); | |
services.AddScoped<IProductService, ProductService>(); | |
services.AddAutoMapper(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment