Exemple #1
0
        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)}>");
            }
        }
Exemple #2
0
        public EfData(ICodeItDbContext dbContext)
        {
            Guard.WhenArgument(dbContext, nameof(dbContext)).IsNull().Throw();

            this.dbContext = dbContext;
        }