Example #1
0
 public static NullableDataSourceStandard <OptionalCollectionStateValidator <TValue>, UniqueValidator <TValue>, TValue[]> Unique <TValue>(this OptionalCollectionStateValidator <TValue> source)
 => source.Add(new UniqueValidator <TValue>());
Example #2
0
 public static NullableDataSourceStandard <OptionalCollectionStateValidator <TValue>, ItemCountValidator <TValue>, TValue[]> ItemCount <TValue>(this OptionalCollectionStateValidator <TValue> source, int?minimumItems = null, int?maximumItems = null)
 => source.Add(new ItemCountValidator <TValue>(minimumItems, maximumItems));
Example #3
0
 public static NullableDataSourceInverted <OptionalCollectionStateValidator <TValue>, TValueValidator, TValue[]> Not <TValueValidator, TValue>(this OptionalCollectionStateValidator <TValue> source, Func <OptionalCollectionStateValidator <TValue>, NullableDataSourceStandard <OptionalCollectionStateValidator <TValue>, TValueValidator, TValue[]> > validatorFactory)
     where TValueValidator : IValueValidator <TValue[]>
 => validatorFactory.Invoke(source).InvertOne();
Example #4
0
 public static NullableDataSourceStandard <OptionalCollectionStateValidator <TValue>, CustomValidator <TValue[]>, TValue[]> Assert <TValue>(this OptionalCollectionStateValidator <TValue> source, string description, Func <TValue[], bool> validator)
 => source.Add(new CustomValidator <TValue[]>(description, validator));
Example #5
0
        // Optional Collection

        public static NullableDataSourceStandard <OptionalCollectionStateValidator <TValue>, TValueValidator, TValue[]> Add <TValueValidator, TValue>(this OptionalCollectionStateValidator <TValue> optionalCollection, TValueValidator valueValidator)
            where TValueValidator : IValueValidator <TValue[]>
        => new NullableDataSourceStandard <OptionalCollectionStateValidator <TValue>, TValueValidator, TValue[]>(optionalCollection, valueValidator);
Example #6
0
 public static DataSourceStandard <NullableCollectionDataContainerFactory <OptionalCollectionStateValidator <TValue>, TValue, TValue>, Option <TValue[]>, TValue[], ItemCountValidator <TValue> > ItemCount <TValue>(this OptionalCollectionStateValidator <TValue> source, int?minimumItems = null, int?maximumItems = null)
 => source.Add(new ItemCountValidator <TValue>(minimumItems, maximumItems));
Example #7
0
 public static DataSourceStandard <NullableCollectionDataContainerFactory <OptionalCollectionStateValidator <TValue>, TValue, TValue>, Option <TValue[]>, TValue[], UniqueValidator <TValue> > Unique <TValue>(this OptionalCollectionStateValidator <TValue> source)
 => source.Add(new UniqueValidator <TValue>());
Example #8
0
 public static DataSourceStandard <NullableCollectionDataContainerFactory <OptionalCollectionStateValidator <TValue>, TValue, TValue>, Option <TValue[]>, TValue[], CustomValidator <TValue[]> > Assert <TValue>(this OptionalCollectionStateValidator <TValue> source, string description, Func <TValue[], bool> validator)
 => source.Add(new CustomValidator <TValue[]>(description, validator));
Example #9
0
 public static DataSourceInverted <NullableCollectionDataContainerFactory <OptionalCollectionStateValidator <TValue>, TValue, TValue>, Option <TValue[]>, TValue[], TValueValidator> Not <TValue, TValueValidator>(this OptionalCollectionStateValidator <TValue> source, Func <OptionalCollectionStateValidator <TValue>, DataSourceStandard <NullableCollectionDataContainerFactory <OptionalCollectionStateValidator <TValue>, TValue, TValue>, Option <TValue[]>, TValue[], TValueValidator> > validatorFactory)
     where TValueValidator : struct, IValueValidator <TValue[]>
 => validatorFactory.Invoke(source).InvertOne();