4using System.Collections.Generic;
6using System.Reflection;
17 if (newSpecification ==
null)
19 throw new ArgumentNullException(nameof(newSpecification));
29 throw new ArgumentNullException(nameof(newValue));
40 return specProp.
Property.PropertyType.GetTypeInfo()
41 .GetGenericArguments()
45 InvalidOperationException(
"Sequence properties should be of type IEnumerable<T>."
49 return specProp.
Property.PropertyType;
53 public static IEnumerable<Error>
Validate(
this IEnumerable<SpecificationProperty> specProps,
54 IEnumerable<Func<IEnumerable<SpecificationProperty>,
55 IEnumerable<Error>>> rules)
57 return rules.SelectMany(rule => rule(specProps));
The Maybe type models an optional value. A value of type Maybe a either contains a value of type a (r...
static Type GetConversionType(this SpecificationProperty specProp)
static SpecificationProperty WithSpecification(this SpecificationProperty specProp, Specification newSpecification)
static SpecificationProperty WithValue(this SpecificationProperty specProp, Maybe< object > newValue)
static IEnumerable< Error > Validate(this IEnumerable< SpecificationProperty > specProps, IEnumerable< Func< IEnumerable< SpecificationProperty >, IEnumerable< Error > > > rules)
Specification Specification
static SpecificationProperty Create(Specification specification, PropertyInfo property, Maybe< object > value)