Search Results for

    Show / Hide Table of Contents

    Class Union<TFirst, TSecond>

    Represents the union of two types, TFirst and TSecond. Used in scenarios where an OpenSearch API may accept more than one different input data structure.

    Inheritance
    object
    Union<TFirst, TSecond>
    Context
    Indices
    Like
    MinimumShouldMatch
    Slices
    StopWords
    TrackTotalHits
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: OpenSearch.Client
    Assembly: OpenSearch.Client.dll
    Syntax
    public class Union<TFirst, TSecond>
    Type Parameters
    Name Description
    TFirst

    The first type

    TSecond

    The second type

    Constructors

    | Edit this page View Source

    Union(TFirst)

    Creates an new instance of Union<TFirst, TSecond> that encapsulates item value

    Declaration
    public Union(TFirst item)
    Parameters
    Type Name Description
    TFirst item

    The value to encapsulate

    | Edit this page View Source

    Union(TSecond)

    Creates an new instance of Union<TFirst, TSecond> that encapsulates item value

    Declaration
    public Union(TSecond item)
    Parameters
    Type Name Description
    TSecond item

    The value to encapsulate

    Methods

    | Edit this page View Source

    Match(Action<TFirst>, Action<TSecond>)

    Runs an Action<T> delegate against the encapsulated value

    Declaration
    public void Match(Action<TFirst> first, Action<TSecond> second)
    Parameters
    Type Name Description
    Action<TFirst> first

    The delegate to run when this instance encapsulates an instance of TFirst

    Action<TSecond> second

    The delegate to run when this instance encapsulates an instance of TSecond

    | Edit this page View Source

    Match<T>(Func<TFirst, T>, Func<TSecond, T>)

    Runs a Func<T, TResult> delegate against the encapsulated value

    Declaration
    public T Match<T>(Func<TFirst, T> first, Func<TSecond, T> second)
    Parameters
    Type Name Description
    Func<TFirst, T> first

    The delegate to run when this instance encapsulates an instance of TFirst

    Func<TSecond, T> second

    The delegate to run when this instance encapsulates an instance of TSecond

    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T

    Operators

    | Edit this page View Source

    implicit operator Union<TFirst, TSecond>(TFirst)

    Declaration
    public static implicit operator Union<TFirst, TSecond>(TFirst first)
    Parameters
    Type Name Description
    TFirst first
    Returns
    Type Description
    Union<TFirst, TSecond>
    | Edit this page View Source

    implicit operator Union<TFirst, TSecond>(TSecond)

    Declaration
    public static implicit operator Union<TFirst, TSecond>(TSecond second)
    Parameters
    Type Name Description
    TSecond second
    Returns
    Type Description
    Union<TFirst, TSecond>

    Extension Methods

    SuffixExtensions.Suffix(object, string)
    • Edit this page
    • View Source
    In this article
    • Constructors
      • Union(TFirst)
      • Union(TSecond)
    • Methods
      • Match(Action<TFirst>, Action<TSecond>)
      • Match<T>(Func<TFirst, T>, Func<TSecond, T>)
    • Operators
      • implicit operator Union<TFirst, TSecond>(TFirst)
      • implicit operator Union<TFirst, TSecond>(TSecond)
    • Extension Methods
    Back to top Generated by DocFX