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
originalMethodReturnType
Properties
EqualityContract
protected virtual Type EqualityContract { get; }
Property Value
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
IsTask
Gets a value indicating whether the method is returning a Task or a Task<TResult>.
public bool IsTask { get; init; }
Property Value
IsValueTask
Gets a value indicating whether the method is returning a ValueTask or a ValueTask<TResult>.
public bool IsValueTask { get; init; }
Property Value
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
invokeResultobjectThe return value of the call to Invoke(object, object[]).
Returns
- object
The unwrapped result, or
nullif 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
invokeResultobjectThe return value of the call to Invoke(object, object[]).
Returns
CreateFromMethodInfo(MethodInfo)
Creates a MethodReturnType with the information from the specified MethodInfo.
public static MethodReturnType CreateFromMethodInfo(MethodInfo methodInfo)
Parameters
methodInfoMethodInfoThe MethodInfo.
Returns
Equals(MethodReturnType?)
public virtual bool Equals(MethodReturnType? other)
Parameters
otherMethodReturnType
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
PrintMembers(StringBuilder)
protected virtual bool PrintMembers(StringBuilder builder)
Parameters
builderStringBuilder
Returns
ToString()
public override string ToString()
Returns
Operators
operator ==(MethodReturnType?, MethodReturnType?)
public static bool operator ==(MethodReturnType? left, MethodReturnType? right)
Parameters
leftMethodReturnTyperightMethodReturnType
Returns
operator !=(MethodReturnType?, MethodReturnType?)
public static bool operator !=(MethodReturnType? left, MethodReturnType? right)
Parameters
leftMethodReturnTyperightMethodReturnType