public UnitOfWork(AutomobileWebsiteContext context) { _context = context; _lazyStateRepository = new Lazy <IGenericRepository <State> >(() => new GenericRepository <State>(context), true); _lazyDealershipRepository = new Lazy <IGenericRepository <Dealership> >(() => new GenericRepository <Dealership>(context), true); _lazyDealershipAddressRepository = new Lazy <IGenericRepository <DealershipAddress> >(() => new GenericRepository <DealershipAddress>(context), true); _lazyCarRepository = new Lazy <IGenericRepository <Car> >(() => new GenericRepository <Car>(context), true); }
public GenericRepository(AutomobileWebsiteContext context) { _context = context; _dbSet = context.Set <TEntity>(); }