public static NullableDataSourceStandard <OptionalCollectionStateValidator <TValue>, UniqueValidator <TValue>, TValue[]> Unique <TValue>(this OptionalCollectionStateValidator <TValue> source) => source.Add(new UniqueValidator <TValue>());
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));
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();
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));
// 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);
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));
public static DataSourceStandard <NullableCollectionDataContainerFactory <OptionalCollectionStateValidator <TValue>, TValue, TValue>, Option <TValue[]>, TValue[], UniqueValidator <TValue> > Unique <TValue>(this OptionalCollectionStateValidator <TValue> source) => source.Add(new UniqueValidator <TValue>());
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));
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();