Class Method<TRequest, TResponse> (2.48.0)

public class Method<TRequest, TResponse> : object, IMethod

A description of a remote method.

Inheritance

Object > Method<TRequest, TResponse>

Implements

IMethod

Namespace

Grpc.Core

Assembly

Grpc.Core.Api.dll

Type Parameters

NameDescription
TRequest

Request message type for this method.

TResponse

Response message type for this method.

Constructors

Method(MethodType, String, String, Marshaller<TRequest>, Marshaller<TResponse>)

public Method(MethodType type, string serviceName, string name, Marshaller<TRequest> requestMarshaller, Marshaller<TResponse> responseMarshaller)

Initializes a new instance of the Method class.

Parameters
NameDescription
typeMethodType

Type of method.

serviceNameString

Name of service this method belongs to.

nameString

Unqualified name of the method.

requestMarshallerMarshaller<TRequest>

Marshaller used for request messages.

responseMarshallerMarshaller<TResponse>

Marshaller used for response messages.

Properties

FullName

public string FullName { get; }

Gets the fully qualified name of the method. On the server side, methods are dispatched based on this name.

Property Value
TypeDescription
String

Name

public string Name { get; }

Gets the unqualified name of the method.

Property Value
TypeDescription
String

RequestMarshaller

public Marshaller<TRequest> RequestMarshaller { get; }

Gets the marshaller used for request messages.

Property Value
TypeDescription
Marshaller<TRequest>

ResponseMarshaller

public Marshaller<TResponse> ResponseMarshaller { get; }

Gets the marshaller used for response messages.

Property Value
TypeDescription
Marshaller<TResponse>

ServiceName

public string ServiceName { get; }

Gets the name of the service to which this method belongs.

Property Value
TypeDescription
String

Type

public MethodType Type { get; }

Gets the type of the method.

Property Value
TypeDescription
MethodType