protected void CreateDbContext() { DbContext = new GammaRayContext(); DbContext.Configuration.ProxyCreationEnabled = false; DbContext.Configuration.LazyLoadingEnabled = false; DbContext.Configuration.ValidateOnSaveEnabled = false; }
public Repository(GammaRayContext dbContext) { if (dbContext == null) { throw new ArgumentNullException("dbContext"); } DbContext = dbContext; DbSet = DbContext.Set <T>(); }