public EnumValueDescriptor FindValueByNumber(int number)
Finds an enum value by number. If multiple enum values have the
same number, this returns the first defined value with that number.
If there is no value for the given number, this returns null.
The EnumOptions, 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 EnumDescriptorProto describing this enum.
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\u003eEnumDescriptor\u003c/code\u003e class provides a descriptor for an enum type within a .proto file, acting as an interface to the enum's structure and metadata.\u003c/p\u003e\n"],["\u003cp\u003eThis class allows access to properties like \u003ccode\u003eClrType\u003c/code\u003e, \u003ccode\u003eContainingType\u003c/code\u003e, \u003ccode\u003eCustomOptions\u003c/code\u003e, \u003ccode\u003eName\u003c/code\u003e, and \u003ccode\u003eValues\u003c/code\u003e, offering information about the enum's CLR type, containing message, custom options, name, and its defined values respectively.\u003c/p\u003e\n"],["\u003cp\u003eMethods like \u003ccode\u003eFindValueByName\u003c/code\u003e and \u003ccode\u003eFindValueByNumber\u003c/code\u003e enable searching for enum values by their name or numerical value, respectively.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eGetOptions()\u003c/code\u003e method enables the retrieval of the \u003ccode\u003eEnumOptions\u003c/code\u003e message, which contains options for the enum, including custom extensions, with the note that it is a defensive copy of the message each time it is called.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eToProto()\u003c/code\u003e method returns a copy of the underlying \u003ccode\u003eEnumDescriptorProto\u003c/code\u003e, which is a protobuf representation of this enum descriptor, useful for serialization or inspection.\u003c/p\u003e\n"]]],[],null,["# Class EnumDescriptor (3.27.1)\n\nVersion latestkeyboard_arrow_down\n\n- [3.27.1 (latest)](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Reflection.EnumDescriptor)\n- [3.23.0](/dotnet/docs/reference/Google.Protobuf/3.23.0/Google.Protobuf.Reflection.EnumDescriptor)\n- [3.15.8](/dotnet/docs/reference/Google.Protobuf/3.15.8/Google.Protobuf.Reflection.EnumDescriptor) \n\n public sealed class EnumDescriptor : DescriptorBase, IDescriptor\n\nDescriptor for an enum type in a .proto file. \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 EnumDescriptor \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### ClrType\n\n public Type ClrType { get; }\n\nThe CLR type for this enum. For generated code, this will be a CLR enum type.\n\n### ContainingType\n\n public MessageDescriptor ContainingType { get; }\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 enum.\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### Values\n\n public IList\u003cEnumValueDescriptor\u003e Values { get; }\n\nMethods\n-------\n\n### FindValueByName(string)\n\n public EnumValueDescriptor FindValueByName(string name)\n\nFinds an enum value by name.\n\n### FindValueByNumber(int)\n\n public EnumValueDescriptor FindValueByNumber(int number)\n\nFinds an enum value by number. If multiple enum values have the\nsame number, this returns the first defined value with that number.\nIf there is no value for the given number, this returns `null`.\n\n### GetOption\\\u003cT\\\u003e(Extension\\\u003cEnumOptions, T\\\u003e)\n\n [Obsolete(\"GetOption is obsolete. Use the GetOptions() method.\")]\n public T GetOption\u003cT\u003e(Extension\u003cEnumOptions, T\u003e extension)\n\nGets a single value enum option for this descriptor\n\n### GetOption\\\u003cT\\\u003e(RepeatedExtension\\\u003cEnumOptions, T\\\u003e)\n\n [Obsolete(\"GetOption is obsolete. Use the GetOptions() method.\")]\n public RepeatedField\u003cT\u003e GetOption\u003cT\u003e(RepeatedExtension\u003cEnumOptions, T\u003e extension)\n\nGets a repeated value enum option for this descriptor\n\n### GetOptions()\n\n public EnumOptions GetOptions()\n\nThe `EnumOptions`, 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 EnumDescriptorProto ToProto()\n\nReturns a clone of the underlying [EnumDescriptorProto](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Reflection.EnumDescriptorProto) describing this enum.\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."]]