Show / Hide Table of Contents

    Class MethodReturnType

    Describes the sync or async method return type.

    Inheritance
    object
    MethodReturnType
    Implements
    IEquatable<MethodReturnType>
    Inherited Members
    object.GetType()
    object.MemberwiseClone()
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    Namespace: Silverback.Messaging.Subscribers
    Assembly: Silverback.Core.dll
    Syntax
    public record MethodReturnType : IEquatable<MethodReturnType>

    Constructors

    MethodReturnType(MethodReturnType)

    Describes the sync or async method return type.

    Declaration
    protected MethodReturnType(MethodReturnType original)
    Parameters
    Type Name Description
    MethodReturnType original

    Properties

    EqualityContract

    Describes the sync or async method return type.

    Declaration
    protected virtual Type EqualityContract { get; }
    Property Value
    Type Description
    Type

    HasResult

    Gets a value indicating whether the method is returning a Task<TResult> or a ValueTask<TResult> with a result.

    Declaration
    public bool HasResult { get; }
    Property Value
    Type Description
    bool

    IsTask

    Gets a value indicating whether the method is returning a Task or a Task<TResult>.

    Declaration
    public bool IsTask { get; init; }
    Property Value
    Type Description
    bool

    IsValueTask

    Gets a value indicating whether the method is returning a ValueTask or a ValueTask<TResult>.

    Declaration
    public bool IsValueTask { get; init; }
    Property Value
    Type Description
    bool

    Methods

    AwaitAndUnwrapResult(object?)

    Handles the result of the method invoked via reflection awaiting the Task or ValueTask and unwrapping the Task<TResult> or ValueTask<TResult> result.

    Declaration
    public object? AwaitAndUnwrapResult(object? invokeResult)
    Parameters
    Type Name Description
    object invokeResult

    The return value of the call to Invoke(object, object[]).

    Returns
    Type Description
    object

    The unwrapped result, or null if the method doesn't have a return value.

    AwaitAndUnwrapResultAsync(object?)

    Handles the result of the method invoked via reflection awaiting the Task or ValueTask and unwrapping the Task<TResult> or ValueTask<TResult> result.

    Declaration
    public Task<object?> AwaitAndUnwrapResultAsync(object? invokeResult)
    Parameters
    Type Name Description
    object invokeResult

    The return value of the call to Invoke(object, object[]).

    Returns
    Type Description
    Task<object>

    The unwrapped result, or null if the method doesn't have a return value.

    CreateFromMethodInfo(MethodInfo)

    Creates a MethodReturnType with the information from the specified MethodInfo.

    Declaration
    public static MethodReturnType CreateFromMethodInfo(MethodInfo methodInfo)
    Parameters
    Type Name Description
    MethodInfo methodInfo

    The MethodInfo.

    Returns
    Type Description
    MethodReturnType

    The MethodReturnType.

    Equals(MethodReturnType?)

    Describes the sync or async method return type.

    Declaration
    public virtual bool Equals(MethodReturnType? other)
    Parameters
    Type Name Description
    MethodReturnType other
    Returns
    Type Description
    bool

    Equals(object?)

    Describes the sync or async method return type.

    Declaration
    public override bool Equals(object? obj)
    Parameters
    Type Name Description
    object obj
    Returns
    Type Description
    bool
    Overrides
    object.Equals(object)

    GetHashCode()

    Describes the sync or async method return type.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int
    Overrides
    object.GetHashCode()

    PrintMembers(StringBuilder)

    Describes the sync or async method return type.

    Declaration
    protected virtual bool PrintMembers(StringBuilder builder)
    Parameters
    Type Name Description
    StringBuilder builder
    Returns
    Type Description
    bool

    ToString()

    Describes the sync or async method return type.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string
    Overrides
    object.ToString()

    Operators

    operator ==(MethodReturnType?, MethodReturnType?)

    Describes the sync or async method return type.

    Declaration
    public static bool operator ==(MethodReturnType? left, MethodReturnType? right)
    Parameters
    Type Name Description
    MethodReturnType left
    MethodReturnType right
    Returns
    Type Description
    bool

    operator !=(MethodReturnType?, MethodReturnType?)

    Describes the sync or async method return type.

    Declaration
    public static bool operator !=(MethodReturnType? left, MethodReturnType? right)
    Parameters
    Type Name Description
    MethodReturnType left
    MethodReturnType right
    Returns
    Type Description
    bool

    Implements

    IEquatable<T>
    GitHub E-Mail
    ↑ Back to top © 2026 Sergio Aquilini