Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void ConfigureServices(IServiceCollection services)
- {
- var mappingConfig = new MapperConfiguration(mc =>
- {
- mc.AddProfile(new Data.Configure.MappingProfile());
- mc.AddProfile(new Services.Configuration.MappingProfile());
- });
- var mapper = mappingConfig.CreateMapper();
- services.AddSingleton(mapper);
- services.AddMvc().AddFluentValidation().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
- services.AddDbContext<TaskierContext>((obj) =>
- {
- obj.UseSqlServer(Configuration.GetConnectionString("Default"), opt => opt.MigrationsAssembly("Taskier.Data"));
- });
- //Validators
- services.AddTransient<IValidator<CreateTaskRequest>, CreateTaskRequestValidator>();
- //Services
- services.AddScoped<IRepoFactory, RepoFactory>();
- services.AddScoped<IServiceFactory, ServiceFactory>();
- }
Add Comment
Please, Sign In to add comment