DiscriminatedUnionWithBaseList<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, Type10, BaseType> Class

Summary

Represents a list of Discriminated unions with a common baseclass. Using this list you can add items without having to specify the union type.
Namespace
FunctionalSharp.DiscriminatedUnions
Interfaces
  • IList<DiscriminatedUnionWithBase<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, Type10, BaseType>>
  • ICollection<DiscriminatedUnionWithBase<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, Type10, BaseType>>
  • IList
  • ICollection
  • IReadOnlyList<DiscriminatedUnionWithBase<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, Type10, BaseType>>
  • IReadOnlyCollection<DiscriminatedUnionWithBase<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, Type10, BaseType>>
  • IEnumerable<DiscriminatedUnionWithBase<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, Type10, BaseType>>
  • IEnumerable
Base Types
  • object
  • List<DiscriminatedUnionWithBase<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, Type10, BaseType>>
graph TD Base0["List<DiscriminatedUnionWithBase<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, Type10, BaseType>>"]-->Type Base1["object"]-->Base0 Interface0["IList<DiscriminatedUnionWithBase<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, Type10, BaseType>>"]-.->Type Interface1["ICollection<DiscriminatedUnionWithBase<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, Type10, BaseType>>"]-.->Type Interface2["IList"]-.->Type Interface3["ICollection"]-.->Type Interface4["IReadOnlyList<DiscriminatedUnionWithBase<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, Type10, BaseType>>"]-.->Type Interface5["IReadOnlyCollection<DiscriminatedUnionWithBase<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, Type10, BaseType>>"]-.->Type Interface6["IEnumerable<DiscriminatedUnionWithBase<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, Type10, BaseType>>"]-.->Type Interface7["IEnumerable"]-.->Type Type["DiscriminatedUnionWithBaseList<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, Type10, BaseType>"] class Type type-node

Syntax

[Serializable]
public class DiscriminatedUnionWithBaseList<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, Type10, BaseType> : 
    
    List<DiscriminatedUnionWithBase<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, Type10, BaseType>>, 
    
    IList<DiscriminatedUnionWithBase<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, Type10, BaseType>>, 
    
    ICollection<DiscriminatedUnionWithBase<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, Type10, BaseType>>, 
    IList, ICollection, 
    
    IReadOnlyList<DiscriminatedUnionWithBase<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, Type10, BaseType>>, 
    
    IReadOnlyCollection<DiscriminatedUnionWithBase<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, Type10, BaseType>>, 
    
    IEnumerable<DiscriminatedUnionWithBase<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, Type10, BaseType>>, 
    IEnumerable
    
    where Type1 : BaseType where Type2 : BaseType where Type3 : BaseType where Type4 : BaseType where Type5 : BaseType where Type6 : BaseType where Type7 : BaseType where Type8 : BaseType where Type9 : BaseType where Type10 : BaseType

Attributes

Type Description
SerializableAttribute

Type Parameters

Name Description
Type1
Type2
Type3
Type4
Type5
Type6
Type7
Type8
Type9
Type10
BaseType

Methods

Name Value Summary
Add(Type1) void
Adds the object to the end of the DiscriminatedUnionList
Add(Type10) void
Adds the object to the end of the DiscriminatedUnionList
Add(Type2) void
Adds the object to the end of the DiscriminatedUnionList
Add(Type3) void
Adds the object to the end of the DiscriminatedUnionList
Add(Type4) void
Adds the object to the end of the DiscriminatedUnionList
Add(Type5) void
Adds the object to the end of the DiscriminatedUnionList
Add(Type6) void
Adds the object to the end of the DiscriminatedUnionList
Add(Type7) void
Adds the object to the end of the DiscriminatedUnionList
Add(Type8) void
Adds the object to the end of the DiscriminatedUnionList
Add(Type9) void
Adds the object to the end of the DiscriminatedUnionList
AddRange(IEnumerable<Type1>) void
Adds a Enumerable of items to the list.
AddRange(IEnumerable<Type10>) void
Adds a Enumerable of items to the list.
AddRange(IEnumerable<Type2>) void
Adds a Enumerable of items to the list.
AddRange(IEnumerable<Type3>) void
Adds a Enumerable of items to the list.
AddRange(IEnumerable<Type4>) void
Adds a Enumerable of items to the list.
AddRange(IEnumerable<Type5>) void
Adds a Enumerable of items to the list.
AddRange(IEnumerable<Type6>) void
Adds a Enumerable of items to the list.
AddRange(IEnumerable<Type7>) void
Adds a Enumerable of items to the list.
AddRange(IEnumerable<Type8>) void
Adds a Enumerable of items to the list.
AddRange(IEnumerable<Type9>) void
Adds a Enumerable of items to the list.

Extension Methods

Name Value Summary
Match<DiscriminatedUnionWithBase<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, Type10, BaseType>>() PatternMatchContext<T>
Starts a pattern match. Subsequent calls to With() need to be used to specify conditions
Match<DiscriminatedUnionWithBaseList<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, Type10, BaseType>>() PatternMatchSingleContext<T>
Starts a pattern match for a single value. Subsequent calls to With() need to be used to specify conditions
Match<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, Type10, BaseType, ReturnType>(Func<Type1, ReturnType>, Func<Type2, ReturnType>, Func<Type3, ReturnType>, Func<Type4, ReturnType>, Func<Type5, ReturnType>, Func<Type6, ReturnType>, Func<Type7, ReturnType>, Func<Type8, ReturnType>, Func<Type9, ReturnType>, Func<Type10, ReturnType>) IEnumerable<ReturnType>
Transforms the list matching the specific types and extecuting a function for them.
Match<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, Type10, BaseType>(Action<Type1>, Action<Type2>, Action<Type3>, Action<Type4>, Action<Type5>, Action<Type6>, Action<Type7>, Action<Type8>, Action<Type9>, Action<Type10>) void
Runs actions for the specific matching types.
MatchDiscriminated<DiscriminatedUnionWithBase<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, Type10, BaseType>>() DiscriminatedPatternMatchContext<T>
Merge<DiscriminatedUnionWithBase<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, Type10, BaseType>, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9>(IEnumerable<Type2>, IEnumerable<Type3>, IEnumerable<Type4>, IEnumerable<Type5>, IEnumerable<Type6>, IEnumerable<Type7>, IEnumerable<Type8>, IEnumerable<Type9>) IEnumerable<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9>>
Merges to given collections into a discriminated union collection.
Merge<DiscriminatedUnionWithBase<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, Type10, BaseType>, Type2, Type3, Type4, Type5, Type6, Type7, Type8>(IEnumerable<Type2>, IEnumerable<Type3>, IEnumerable<Type4>, IEnumerable<Type5>, IEnumerable<Type6>, IEnumerable<Type7>, IEnumerable<Type8>) IEnumerable<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8>>
Merges to given collections into a discriminated union collection.
Merge<DiscriminatedUnionWithBase<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, Type10, BaseType>, Type2, Type3, Type4, Type5, Type6, Type7>(IEnumerable<Type2>, IEnumerable<Type3>, IEnumerable<Type4>, IEnumerable<Type5>, IEnumerable<Type6>, IEnumerable<Type7>) IEnumerable<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5, Type6, Type7>>
Merges to given collections into a discriminated union collection.
Merge<DiscriminatedUnionWithBase<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, Type10, BaseType>, Type2, Type3, Type4, Type5, Type6>(IEnumerable<Type2>, IEnumerable<Type3>, IEnumerable<Type4>, IEnumerable<Type5>, IEnumerable<Type6>) IEnumerable<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5, Type6>>
Merges to given collections into a discriminated union collection.
Merge<DiscriminatedUnionWithBase<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, Type10, BaseType>, Type2, Type3, Type4, Type5>(IEnumerable<Type2>, IEnumerable<Type3>, IEnumerable<Type4>, IEnumerable<Type5>) IEnumerable<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5>>
Merges to given collections into a discriminated union collection.
Merge<DiscriminatedUnionWithBase<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, Type10, BaseType>, Type2, Type3, Type4>(IEnumerable<Type2>, IEnumerable<Type3>, IEnumerable<Type4>) IEnumerable<DiscriminatedUnion<Type1, Type2, Type3, Type4>>
Merges to given collections into a discriminated union collection.
Merge<DiscriminatedUnionWithBase<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, Type10, BaseType>, Type2, Type3>(IEnumerable<Type2>, IEnumerable<Type3>) IEnumerable<DiscriminatedUnion<Type1, Type2, Type3>>
Merges to given collections into a discriminated union collection.
Merge<DiscriminatedUnionWithBase<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, Type10, BaseType>, Type2>(IEnumerable<Type2>) IEnumerable<DiscriminatedUnion<Type1, Type2>>
Merges to given collections into a discriminated union collection.
SafeSingle<DiscriminatedUnionWithBase<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, Type10, BaseType>>(Func<DiscriminatedUnionWithBase<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, Type10, BaseType>, bool>) DiscriminatedUnion<T, MultipleResultsException, EmptySequenceException>
provides a mechanism to use Single on a collection that returns a discriminated union instead of an exception.
ToOption<DiscriminatedUnionWithBaseList<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, Type10, BaseType>>() IOption<T>
Turns the type T into an option type.