[[["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\u003eOneofAccessor\u003c/code\u003e class provides reflection access for a oneof, enabling operations to clear and retrieve the current case.\u003c/p\u003e\n"],["\u003cp\u003eIt inherits from the \u003ccode\u003eobject\u003c/code\u003e class and is found within the \u003ccode\u003eGoogle.Protobuf.Reflection\u003c/code\u003e namespace in the \u003ccode\u003eGoogle.Protobuf.dll\u003c/code\u003e assembly.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eDescriptor\u003c/code\u003e property allows access to the \u003ccode\u003eOneofDescriptor\u003c/code\u003e, giving detailed information about the oneof.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eClear\u003c/code\u003e method allows you to clear the oneof in a specified message of type \u003ccode\u003eIMessage\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eGetCaseFieldDescriptor\u003c/code\u003e method indicates which field within the oneof is currently set for a given \u003ccode\u003eIMessage\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Class OneofAccessor (3.27.1)\n\nVersion latestkeyboard_arrow_down\n\n- [3.27.1 (latest)](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Reflection.OneofAccessor)\n- [3.23.0](/dotnet/docs/reference/Google.Protobuf/3.23.0/Google.Protobuf.Reflection.OneofAccessor)\n- [3.15.8](/dotnet/docs/reference/Google.Protobuf/3.15.8/Google.Protobuf.Reflection.OneofAccessor) \n\n public sealed class OneofAccessor\n\nReflection access for a oneof, allowing clear and \"get case\" actions. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e OneofAccessor \n\nInherited Members\n-----------------\n\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### Descriptor\n\n public OneofDescriptor Descriptor { get; }\n\nGets the descriptor for this oneof.\n\nMethods\n-------\n\n### Clear(IMessage)\n\n public void Clear(IMessage message)\n\nClears the oneof in the specified message.\n\n### GetCaseFieldDescriptor(IMessage)\n\n public FieldDescriptor GetCaseFieldDescriptor(IMessage message)\n\nIndicates which field in the oneof is set for specified message"]]