Table of Contents

Class MethodReturnType

Namespace
Silverback.Messaging.Subscribers
Assembly
Silverback.Core.dll

Describes the sync or async method return type.

public record MethodReturnType : IEquatable<MethodReturnType>
Inheritance
MethodReturnType
Implements
Inherited Members

Constructors

MethodReturnType(MethodReturnType)

protected MethodReturnType(MethodReturnType original)

Parameters

original MethodReturnType

Properties

EqualityContract

protected virtual Type EqualityContract { get; }

Property Value

Type

HasResult

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

public bool HasResult { get; }

Property Value

bool

IsTask

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

public bool IsTask { get; init; }

Property Value

bool

IsValueTask

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

public bool IsValueTask { get; init; }

Property Value

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.

public object? AwaitAndUnwrapResult(object? invokeResult)

Parameters

invokeResult object

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

Returns

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.

public Task<object?> AwaitAndUnwrapResultAsync(object? invokeResult)

Parameters

invokeResult object

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

Returns

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.

public static MethodReturnType CreateFromMethodInfo(MethodInfo methodInfo)

Parameters

methodInfo MethodInfo

The MethodInfo.

Returns

MethodReturnType

The MethodReturnType.

Equals(MethodReturnType?)

public virtual bool Equals(MethodReturnType? other)

Parameters

other MethodReturnType

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

PrintMembers(StringBuilder)

protected virtual bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

ToString()

public override string ToString()

Returns

string

Operators

operator ==(MethodReturnType?, MethodReturnType?)

public static bool operator ==(MethodReturnType? left, MethodReturnType? right)

Parameters

left MethodReturnType
right MethodReturnType

Returns

bool

operator !=(MethodReturnType?, MethodReturnType?)

public static bool operator !=(MethodReturnType? left, MethodReturnType? right)

Parameters

left MethodReturnType
right MethodReturnType

Returns

bool