コード例 #1
0
        public void ThrowArgumentNullExceptionIfDbContextPassedIsNull()
        {
            // Arrange
            IAquaWorldDbContext nullContext = null;

            // Act & Assert
            Assert.That(() => new EfAquaWorldDataProvider <ICreature>(nullContext),
                        Throws.InstanceOf <ArgumentNullException>());
        }
コード例 #2
0
        public EfAquaWorldDataProvider(IAquaWorldDbContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("An instance of DbContext is required to use this repository.", "context");
            }

            this.Context = context;
            this.DbSet   = this.Context.Set <T>();
        }