Skip to content

OrleansGeneratedCodeHelper Methods

Utilities for use by generated code.

DeserializeUnexpectedType(Reader<TInput>, Field)

staticextension
View source
public static TField DeserializeUnexpectedType<TInput, TField>(this ref Reader<TInput> reader, scoped ref Field field)
Deserializes an unexpected value.

Parameters

readerReader<TInput>
The reader.
fieldField
The field.

Returns

The value.

GetMethodInfoOrDefault(Type?, string, Type[]?, Type[]?)

static
View source
public static MethodInfo? GetMethodInfoOrDefault(Type? interfaceType, string methodName, Type[]? methodTypeParameters, Type[]? parameterTypes)
Gets the System.Reflection.MethodInfo matching the provided values.

Parameters

interfaceTypeType?
Type of the interface.
methodNamestring
Name of the method.
methodTypeParametersType[]?
The method type parameters.
parameterTypesType[]?
The parameter types.

Returns

The corresponding System.Reflection.MethodInfo.

GetService(object, ICodecProvider)

static
View source
public static TService GetService<TService>(object caller, ICodecProvider codecProvider)
Unwraps the provided service if it was wrapped.

Parameters

callerobject
The caller.
codecProviderICodecProvider
The codec provider.

Returns

The unwrapped service.

SerializeUnexpectedType(Writer<TBufferWriter>, uint, Type, object)

staticextension
View source
public static void SerializeUnexpectedType<TBufferWriter>(this ref Writer<TBufferWriter> writer, uint fieldIdDelta, Type expectedType, object value)
Serializes an unexpected value.

Parameters

writerWriter<TBufferWriter>
The writer.
fieldIdDeltauint
The field identifier delta.
expectedTypeType
The expected type.
valueobject
The value.

UnwrapService(object, TService)

static
View source
public static TService UnwrapService<TService>(object caller, TService service)
Unwraps the provided service if it was wrapped.

Parameters

callerobject
The caller.
serviceTService
The service.

Returns

The unwrapped service.