# Class Method&lt;TRequest, TResponse&gt; (2.66.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [2.66.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.Method-2)
- [2.63.0](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/2.63.0/Grpc.Core.Method-2)
- [2.48.0](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/2.48.0/Grpc.Core.Method-2)

    public class Method<TRequest, TResponse> : IMethod

A description of a remote method.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> Method\<TRequest, TResponse\>

## Implements

[IMethod](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.IMethod)

## Inherited Members

[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)) [object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) [object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Grpc.Core](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core)

## Assembly

Grpc.Core.Api.dll

| ## Type Parameters ||
|---|---|
| **Name** | **Description** |
| `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** ||
|---|---|
| **Name** | **Description** |
| `type` | `https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.MethodType` Type of method. |
| `serviceName` | `https://learn.microsoft.com/dotnet/api/system.string` Name of service this method belongs to. |
| `name` | `https://learn.microsoft.com/dotnet/api/system.string` Unqualified name of the method. |
| `requestMarshaller` | `https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.Marshaller-1` Marshaller used for request messages. |
| `responseMarshaller` | `https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.Marshaller-1` 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** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### Name

    public string Name { get; }

Gets the unqualified name of the method.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### RequestMarshaller

    public Marshaller<TRequest> RequestMarshaller { get; }

Gets the marshaller used for request messages.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.Marshaller-1` |   |

### ResponseMarshaller

    public Marshaller<TResponse> ResponseMarshaller { get; }

Gets the marshaller used for response messages.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.Marshaller-1` |   |

### ServiceName

    public string ServiceName { get; }

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

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### Type

    public MethodType Type { get; }

Gets the type of the method.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.MethodType` |   |