The MethodOptions, defined in descriptor.proto.
If the options message is not present (i.e. there are no options), null is returned.
Custom options can be retrieved as extensions of the returned message.
NOTE: A defensive copy is created each time this property is retrieved.
Returns a clone of the underlying MethodDescriptorProto describing this method.
Note that a copy is taken every time this method is called, so clients using it frequently
(and not modifying it) may want to cache the returned value.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eMethodDescriptor\u003c/code\u003e class describes a single method within a service, inheriting from \u003ccode\u003eDescriptorBase\u003c/code\u003e and implementing \u003ccode\u003eIDescriptor\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eIt includes properties like \u003ccode\u003eInputType\u003c/code\u003e and \u003ccode\u003eOutputType\u003c/code\u003e, which specify the input and output message types for the method.\u003c/p\u003e\n"],["\u003cp\u003eIt indicates if the method supports client or server-side streaming via the \u003ccode\u003eIsClientStreaming\u003c/code\u003e and \u003ccode\u003eIsServerStreaming\u003c/code\u003e properties respectively.\u003c/p\u003e\n"],["\u003cp\u003eThe class also features methods such as \u003ccode\u003eGetOptions()\u003c/code\u003e to retrieve method options and \u003ccode\u003eToProto()\u003c/code\u003e to obtain a protobuf representation of the method descriptor.\u003c/p\u003e\n"],["\u003cp\u003eThis class is in the \u003ccode\u003eGoogle.Protobuf.Reflection\u003c/code\u003e namespace and is part of the Google.Protobuf.dll assembly.\u003c/p\u003e\n"]]],[],null,["# Class MethodDescriptor (3.27.1)\n\nVersion latestkeyboard_arrow_down\n\n- [3.27.1 (latest)](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Reflection.MethodDescriptor)\n- [3.23.0](/dotnet/docs/reference/Google.Protobuf/3.23.0/Google.Protobuf.Reflection.MethodDescriptor)\n- [3.15.8](/dotnet/docs/reference/Google.Protobuf/3.15.8/Google.Protobuf.Reflection.MethodDescriptor) \n\n public sealed class MethodDescriptor : DescriptorBase, IDescriptor\n\nDescribes a single method in a service. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e [DescriptorBase](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Reflection.DescriptorBase) \\\u003e MethodDescriptor \n\nImplements\n----------\n\n[IDescriptor](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Reflection.IDescriptor) \n\nInherited Members\n-----------------\n\n[DescriptorBase.Index](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Reflection.DescriptorBase#Google_Protobuf_Reflection_DescriptorBase_Index) \n[DescriptorBase.FullName](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Reflection.DescriptorBase#Google_Protobuf_Reflection_DescriptorBase_FullName) \n[DescriptorBase.File](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Reflection.DescriptorBase#Google_Protobuf_Reflection_DescriptorBase_File) \n[DescriptorBase.Declaration](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Reflection.DescriptorBase#Google_Protobuf_Reflection_DescriptorBase_Declaration) \n[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)) \n[object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) \n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Protobuf.Reflection](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Reflection)\n\nAssembly\n--------\n\nGoogle.Protobuf.dll\n\nProperties\n----------\n\n### CustomOptions\n\n [Obsolete(\"CustomOptions are obsolete. Use the GetOptions() method.\")]\n public CustomOptions CustomOptions { get; }\n\nThe (possibly empty) set of custom options for this method.\n\n### InputType\n\n public MessageDescriptor InputType { get; }\n\n### IsClientStreaming\n\n public bool IsClientStreaming { get; }\n\n### IsServerStreaming\n\n public bool IsServerStreaming { get; }\n\n### Name\n\n public override string Name { get; }\n\nThe brief name of the descriptor's target.\n\n**Overrides** \n[DescriptorBase.Name](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Reflection.DescriptorBase#Google_Protobuf_Reflection_DescriptorBase_Name)\n\n### OutputType\n\n public MessageDescriptor OutputType { get; }\n\n### Service\n\n public ServiceDescriptor Service { get; }\n\nMethods\n-------\n\n### GetOption\\\u003cT\\\u003e(Extension\\\u003cMethodOptions, T\\\u003e)\n\n [Obsolete(\"GetOption is obsolete. Use the GetOptions() method.\")]\n public T GetOption\u003cT\u003e(Extension\u003cMethodOptions, T\u003e extension)\n\nGets a single value method option for this descriptor\n\n### GetOption\\\u003cT\\\u003e(RepeatedExtension\\\u003cMethodOptions, T\\\u003e)\n\n [Obsolete(\"GetOption is obsolete. Use the GetOptions() method.\")]\n public RepeatedField\u003cT\u003e GetOption\u003cT\u003e(RepeatedExtension\u003cMethodOptions, T\u003e extension)\n\nGets a repeated value method option for this descriptor\n\n### GetOptions()\n\n public MethodOptions GetOptions()\n\nThe `MethodOptions`, defined in `descriptor.proto`.\nIf the options message is not present (i.e. there are no options), `null` is returned.\nCustom options can be retrieved as extensions of the returned message.\nNOTE: A defensive copy is created each time this property is retrieved.\n\n### ToProto()\n\n public MethodDescriptorProto ToProto()\n\nReturns a clone of the underlying [MethodDescriptorProto](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Reflection.MethodDescriptorProto) describing this method.\nNote that a copy is taken every time this method is called, so clients using it frequently\n(and not modifying it) may want to cache the returned value."]]