예제 #1
0
        public EntityFrameworkRepository(IParserDbContext parserDbContext)
        {
            Guard.WhenArgument(parserDbContext, nameof(IParserDbContext)).IsNull().Throw();

            this.parserDbContext = parserDbContext;

            this.entities = this.parserDbContext.Set <TEntity>();
        }
예제 #2
0
        public void ThrowArgumentNullException_WhenIParserDbContextParameterIsNull()
        {
            // Arrange
            IParserDbContext dbContext = null;

            // Act & Assert
            Assert.That(
                () => new GenericRepository <MockDbModel>(dbContext),
                Throws.InstanceOf <ArgumentNullException>().With.Message.Contains(nameof(IParserDbContext)));
        }
 public StoredCombatStatisticsRepository(IParserDbContext dbContext)
     : base(dbContext)
 {
 }
예제 #4
0
        public GenericRepository(IParserDbContext dbContext)
        {
            Guard.WhenArgument(dbContext, nameof(IParserDbContext)).IsNull().Throw();

            this.entities = dbContext.Set <T>();
        }