Exemplo n.º 1
0
        /// <summary>
        /// Gets the data annotations attribute used to apply the specified configuration.
        /// </summary>
        /// <param name="configuration">The configuration.</param>
        /// <returns>The attribute.</returns>
        public string Attribute(IAttributeConfiguration configuration)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }

            return(Attribute(configuration.GetAttributeBody(this)));
        }
Exemplo n.º 2
0
        public ObjectValidations(IAttributeConfiguration <TSource> provider)
        {
            if (provider == null)
            {
                throw new ArgumentNullException(nameof(provider));
            }

            _provider = provider;
        }
Exemplo n.º 3
0
 public PropertyValidations(IAttributeConfiguration <TSource> provider,
                            Expression <Func <TSource, TProperty> > property)
 {
     _provider = provider;
     _property = property;
 }
Exemplo n.º 4
0
        /// <summary>
        /// Gets the data annotations attribute used to apply the specified configuration.
        /// </summary>
        /// <param name="configuration">The configuration.</param>
        /// <returns>The attribute.</returns>
        public string Attribute(IAttributeConfiguration configuration)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }

            return Attribute(configuration.GetAttributeBody(this));
        }
 public static IObjectValidations <TSource> Validations <TSource>(
     this IAttributeConfiguration <TSource> provider)
 {
     return(new ObjectValidations <TSource>(provider));
 }
 public static IPropertyValidations <TSource, TProperty> ValidationsFor <TSource, TProperty>(
     this IAttributeConfiguration <TSource> provider, Expression <Func <TSource, TProperty> > property)
 {
     return(new PropertyValidations <TSource, TProperty>(provider, property));
 }