public override async Task <int> SaveChangesAsync( bool acceptAllChangesOnSuccess, CancellationToken cancellationToken = default) { await DbContextValidator.Validate(this, validatorFactory); return(await base.SaveChangesAsync(acceptAllChangesOnSuccess, cancellationToken)); }
public async Task Validator_CaseInsensitiveColumnNameComparison_ReturnNoErrors() { // Arrange using var context = new ContextWithMixedCaseColumns(_connectionString); var caseInsensitiveValidator = new DbContextValidator(StringComparer.InvariantCultureIgnoreCase); // Act var errors = await caseInsensitiveValidator.ValidateContextAsync(context); // Assert errors.Should().BeEmpty(); }
public override int SaveChanges(bool acceptAllChangesOnSuccess) { DbContextValidator.Validate(this, validatorFactory).GetAwaiter().GetResult(); return(base.SaveChanges(acceptAllChangesOnSuccess)); }
public ValidatorTests(DbFixture dbFixture) { _defaultValidator = new DbContextValidator(StringComparer.InvariantCulture); _connectionString = dbFixture.ConnectionString; }