public EntityFrameworkRepository(IParserDbContext parserDbContext) { Guard.WhenArgument(parserDbContext, nameof(IParserDbContext)).IsNull().Throw(); this.parserDbContext = parserDbContext; this.entities = this.parserDbContext.Set <TEntity>(); }
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) { }
public GenericRepository(IParserDbContext dbContext) { Guard.WhenArgument(dbContext, nameof(IParserDbContext)).IsNull().Throw(); this.entities = dbContext.Set <T>(); }