public EfRepository(ICodeItDbContext dbContext) { Guard.WhenArgument <ICodeItDbContext>(dbContext, nameof(dbContext)).IsNull().Throw(); this.dbContext = dbContext; this.dbSet = this.dbContext.Set <TEntity>(); if (this.dbSet == null) { throw new ArgumentException($"DbContext does not contain DbSet<{nameof(TEntity)}>"); } }
public EfData(ICodeItDbContext dbContext) { Guard.WhenArgument(dbContext, nameof(dbContext)).IsNull().Throw(); this.dbContext = dbContext; }