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
< Discriminated Union With Base <Type1, Type2, BaseType> > - ICollection
< Discriminated Union With Base <Type1, Type2, BaseType> > - IList
- ICollection
- IReadOnlyList
< Discriminated Union With Base <Type1, Type2, BaseType> > - IReadOnlyCollection
< Discriminated Union With Base <Type1, Type2, BaseType> > - IEnumerable
< Discriminated Union With Base <Type1, Type2, BaseType> > - IEnumerable
- IList
- Base Types
-
- object
- List
< Discriminated Union With Base <Type1, Type2, BaseType> >
graph TD
Base0["List<DiscriminatedUnionWithBase<Type1, Type2, BaseType>>"]-->Type
Base1["object"]-->Base0
Interface0["IList<DiscriminatedUnionWithBase<Type1, Type2, BaseType>>"]-.->Type
Interface1["ICollection<DiscriminatedUnionWithBase<Type1, Type2, BaseType>>"]-.->Type
Interface2["IList"]-.->Type
Interface3["ICollection"]-.->Type
Interface4["IReadOnlyList<DiscriminatedUnionWithBase<Type1, Type2, BaseType>>"]-.->Type
Interface5["IReadOnlyCollection<DiscriminatedUnionWithBase<Type1, Type2, BaseType>>"]-.->Type
Interface6["IEnumerable<DiscriminatedUnionWithBase<Type1, Type2, BaseType>>"]-.->Type
Interface7["IEnumerable"]-.->Type
Type["DiscriminatedUnionWithBaseList<Type1, Type2, BaseType>"]
class Type type-node
Syntax
[Serializable]
public class DiscriminatedUnionWithBaseList<Type1, Type2, BaseType> :
List<DiscriminatedUnionWithBase<Type1, Type2, BaseType>>,
IList<DiscriminatedUnionWithBase<Type1, Type2, BaseType>>,
ICollection<DiscriminatedUnionWithBase<Type1, Type2, BaseType>>, IList, ICollection,
IReadOnlyList<DiscriminatedUnionWithBase<Type1, Type2, BaseType>>,
IReadOnlyCollection<DiscriminatedUnionWithBase<Type1, Type2, BaseType>>,
IEnumerable<DiscriminatedUnionWithBase<Type1, Type2, BaseType>>, IEnumerable
where Type1 : BaseType where Type2 : BaseType
Attributes
Type | Description |
---|---|
Serializable |
Type Parameters
Name | Description |
---|---|
Type1 | |
Type2 | |
BaseType |
Methods
Name | Value | Summary |
---|---|---|
Add |
void |
Adds the object to the end of the DiscriminatedUnionList
|
Add |
void |
Adds the object to the end of the DiscriminatedUnionList
|
AddRange |
void |
Adds a Enumerable of items to the list.
|
AddRange |
void |
Adds a Enumerable of items to the list.
|
Merge |
Discriminated |
Merges a type into the existing discriminated union list.
|
Extension Methods
Name | Value | Summary |
---|---|---|
Match |
PatternMatchContext |
Starts a pattern match. Subsequent calls to With() need to be used to specify conditions
|
Match |
Pattern |
Starts a pattern match for a single value. Subsequent calls to With() need to be used to specify conditions
|
Match |
IEnumerable |
Transforms the list matching the specific types and extecuting a function for them.
|
Match |
void |
Runs actions for the specific matching types.
|
Match |
IEnumerable |
Matches the specific types and uses the given functions to tranform into s ingle returntype.
|
Match |
void |
Matches the specific types and executes the given action for them.
|
MatchDiscriminated |
Discriminated |
|
Merge |
IEnumerable |
Merges to given collections into a discriminated union collection.
|
Merge |
IEnumerable |
Merges to given collections into a discriminated union collection.
|
Merge |
IEnumerable |
Merges to given collections into a discriminated union collection.
|
Merge |
IEnumerable |
Merges to given collections into a discriminated union collection.
|
Merge |
IEnumerable |
Merges to given collections into a discriminated union collection.
|
Merge |
IEnumerable |
Merges to given collections into a discriminated union collection.
|
Merge |
IEnumerable |
Merges the item intos the existing discriminatedunions resulting in a new enumerable of discriminated unions with the type of the items as a new option.
|
Merge |
IEnumerable |
Merges to given collections into a discriminated union collection.
|
Merge |
IEnumerable |
Merges to given collections into a discriminated union collection.
|
MergeItem |
IEnumerable |
Merges the item into the existing discriminatedunions resulting in a new enumerable of discriminated unions with the type of the item as a new option.
|
SafeSingle |
DiscriminatedUnion |
provides a mechanism to use Single on a collection that returns a discriminated union instead of an exception.
From LinqExtensions
|
ToOption |
IOption |
Turns the type T into an option type.
From OptionExtensions
|