// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseMvc();

            using (var serviceScope = app.ApplicationServices.GetService <IServiceScopeFactory>().CreateScope())
            {
                ApprovalFlowDBContext dbContext = serviceScope.ServiceProvider.GetRequiredService <ApprovalFlowDBContext>();
                dbContext.Database.Migrate();

                // TODO: Use dbContext if you want to do seeding etc.
            }
        }
 public UnitOfWork(ApprovalFlowDBContext context)
 {
     _context      = context;
     Employees     = new EmployeeRepository(_context);
     ApprovalRules = new ApprovalRuleRepository(_context);
 }
Example #3
0
 public ApprovalRuleRepository(ApprovalFlowDBContext context) : base(context)
 {
 }
Example #4
0
 public EmployeeRepository(ApprovalFlowDBContext context) : base(context)
 {
 }