Esempio n. 1
0
        public void ThrowArgumentNullExceptionIfDbContextPassedIsNull()
        {
            // Arrange
            IComicShopDbContext nullContext = null;

            // Act & Assert
            Assert.That(() => new EfComicShopDataProvider <IComic>(nullContext),
                        Throws.InstanceOf <ArgumentNullException>());
        }
Esempio n. 2
0
        public EfComicShopDataProvider(IComicShopDbContext 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>();
        }