// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddControllers(); services.AddSwaggerGen(c => { c.SwaggerDoc("v1", new OpenApiInfo { Title = "_2.API", Version = "v1" }); }); ApplicationContextService.Configure(services); services.AddSingleton <IValidationState, MvcValidator>(); services.AddSingleton <IDomainValidation, BasicValidation>(); services.AddSingleton <IUnityOfWork, UnityOfWork>(); services.AddSingleton <IApplicationDbContext, ApplicationDbContext>(); services.AddSingleton <IImportacaoRepository, ImportacaoRepository>(); services.AddMediatR(typeof(Startup)); }
public Startup(IConfiguration configuration) { Configuration = configuration; ApplicationContextService = new ApplicationContextService(configuration); }