コード例 #1
0
        public UnitOfWork(IBullsAndCowsDbContext dbContext)
        {
            if (dbContext == null)
            {
                throw new ArgumentNullException("dbContext cannot be null");
            }

            this.dbContext = dbContext;
        }
コード例 #2
0
        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>();
        }
コード例 #3
0
        public Repository(IBullsAndCowsDbContext dbContext)
        {
            Guard.WhenArgument(dbContext, "dbContext cannot be null").IsNull().Throw();

            this.dbContext = dbContext;
        }