// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddControllers(); services.AddDbContext <MyCareDBContext>(option => { option.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")); }); var myCareDbContext = new MyCareDBContext(); services.AddScoped <IPeopleRepository>(sp => new PeopleRepository(myCareDbContext)); services.AddScoped <ITimesheetRepository>(sp => new TimesheetRepository(myCareDbContext)); services.AddScoped <IPeopleService, PeopleService>(); services.AddScoped <ITimesheetService, TimesheetService>(); }
public TimesheetRepository(MyCareDBContext myCareDbContext) : base(myCareDbContext) { }
public PeopleRepository(MyCareDBContext myCareDbContext) : base(myCareDbContext) { }