コード例 #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)));
        }
コード例 #3
0
 public StoredCombatStatisticsRepository(IParserDbContext dbContext)
     : base(dbContext)
 {
 }
コード例 #4
0
        public GenericRepository(IParserDbContext dbContext)
        {
            Guard.WhenArgument(dbContext, nameof(IParserDbContext)).IsNull().Throw();

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