public override async Task <int> SaveChangesAsync(
            bool acceptAllChangesOnSuccess,
            CancellationToken cancellationToken = default)
        {
            await DbContextValidator.Validate(this, validatorFactory);

            return(await base.SaveChangesAsync(acceptAllChangesOnSuccess, cancellationToken));
        }
예제 #2
0
        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));
 }
예제 #4
0
 public ValidatorTests(DbFixture dbFixture)
 {
     _defaultValidator = new DbContextValidator(StringComparer.InvariantCulture);
     _connectionString = dbFixture.ConnectionString;
 }