예제 #1
0
 protected CheckConstraintsOptionsExtension([NotNull] CheckConstraintsOptionsExtension copyFrom)
 {
     _enumCheckConstraintsEnabled          = copyFrom._enumCheckConstraintsEnabled;
     _discriminatorCheckConstraintsEnabled = copyFrom._discriminatorCheckConstraintsEnabled;
     _validationCheckConstraintsOptions    = copyFrom._validationCheckConstraintsOptions is null
         ? null
         : new ValidationCheckConstraintOptions(copyFrom._validationCheckConstraintsOptions);
 }
예제 #2
0
        public virtual CheckConstraintsOptionsExtension WithValidationCheckConstraintsOptions(
            ValidationCheckConstraintOptions validationCheckConstraintsOptions)
        {
            var clone = Clone();

            clone._validationCheckConstraintsOptions = validationCheckConstraintsOptions;
            return(clone);
        }
예제 #3
0
        public ValidationCheckConstraintConvention(
            ValidationCheckConstraintOptions options,
            ISqlGenerationHelper sqlGenerationHelper,
            IRelationalTypeMappingSource relationalTypeMappingSource,
            IDatabaseProvider databaseProvider)
        {
            _sqlGenerationHelper = sqlGenerationHelper;
            _databaseProvider    = databaseProvider;
            _intTypeMapping      = relationalTypeMappingSource.FindMapping(typeof(int));

            _useRegex          = options.UseRegex && SupportsRegex;
            _phoneRegex        = options.PhoneRegex ?? DefaultPhoneRegex;
            _creditCardRegex   = options.CreditCardRegex ?? DefaultCreditCardRegex;
            _emailAddressRegex = options.EmailAddressRegex ?? DefaultEmailAddressRegex;
            _urlRegex          = options.UrlRegex ?? DefaultUrlAddressRegex;
        }