ApplyMaxLengthAttribute.CollectionDescriptor ..
Used to describe how collections should be mutated.
Namespace: Dado.ComponentModel.DataMutations
public sealed class CollectionDescriptorThis class will likely be obsolete once generics or lambdas are implemented for System.Attributes.
| Name | Description |
|---|---|
| CollectionMutator | Gets a function accepting a length and collection which returns a collection. |
| Name | Description |
|---|---|
| SetCollectionMutator<T>(Func<Int32, T, T>) | Sets the CollectionMutator for an ICollection. |
| SetGenericCollectionMutator<T>(Func<Int32, ICollection<T>, ICollection<T>>) | Sets the CollectionMutator for a generic ICollection<T>. |
Gets a function accepting a length and collection which returns a collection.
public Func<int, IEnumerable, IEnumerable> CollectionMutator { get; private set; }- Type
- System.Func<Int32, IEnumerable, IEnumerable>
Sets the CollectionMutator for an ICollection.
public CollectionDescriptor SetCollectionMutator<T>(
Func<int, T, T> mutator
)
where T : ICollection- T
- The type of that describes an ICollection.
Returns this instance of the CollectionDescriptor.
- mutator
- Type: System.Func<System.Int32, `T, `T>
The function accepting a length and collection which returns a collection.
Sets the CollectionMutator for a generic ICollection<T>.
public CollectionDescriptor SetGenericCollectionMutator<T>(
Func<int, ICollection<T>, ICollection<T>> mutator
)- T
- The type of the elements in the collection.
Returns this instance of the CollectionDescriptor.
- mutator
- Type: System.Func<System.Int32, System.Collections.Generic.ICollection<`T>, System.Collections.Generic.ICollection<`T>>
The function accepting a length and collection which returns a collection.