public UnitOfWork(IBullsAndCowsDbContext dbContext) { if (dbContext == null) { throw new ArgumentNullException("dbContext cannot be null"); } this.dbContext = dbContext; }
public EfGenericRepository(IBullsAndCowsDbContext context) { if (context == null) { throw new ArgumentException("An instance of DbContext is required to use this repository.", "context"); } this.Context = context; this.DbSet = this.Context.Set <T>(); }
public Repository(IBullsAndCowsDbContext dbContext) { Guard.WhenArgument(dbContext, "dbContext cannot be null").IsNull().Throw(); this.dbContext = dbContext; }