Metadata key. Gets converted to lowercase. Needs to have-binsuffix indicating a binary-valued metadata entry. The binary header suffix can be added to the key withBinaryHeaderSuffix. Can only contain lowercase alphanumeric characters, underscores, hyphens, and dots.
valueBytes
System.Byte
Value bytes.
Entry(string, string)
public Entry(string key, string value)
Initializes a new instance of theMetadata.Entrystruct with an ASCII value.
Metadata key. Gets converted to lowercase. Must not use '-bin' suffix indicating a binary-valued metadata entry. Can only contain lowercase alphanumeric characters, underscores, hyphens, and dots.
[[["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-09-04 UTC."],[[["\u003cp\u003e\u003ccode\u003eMetadata.Entry\u003c/code\u003e is a class within the \u003ccode\u003eGrpc.Core\u003c/code\u003e namespace, designed for managing metadata entries in gRPC communications.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eMetadata.Entry\u003c/code\u003e class allows for the initialization of new entries with either a string value using ASCII characters or a binary value using bytes.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eIsBinary\u003c/code\u003e property determines if a given entry holds a binary-value.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eKey\u003c/code\u003e property fetches the key for a metadata entry, and \u003ccode\u003eValue\u003c/code\u003e and \u003ccode\u003eValueBytes\u003c/code\u003e return the respective string or byte array values, handling conversions and exceptions as necessary.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eToString()\u003c/code\u003e method, which is overriden from the base \u003ccode\u003eobject\u003c/code\u003e class, returns a string representation of the \u003ccode\u003eMetadata.Entry\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Class Metadata.Entry (2.66.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.66.0 (latest)](/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.Metadata.Entry)\n- [2.63.0](/dotnet/docs/reference/Grpc.Core/2.63.0/Grpc.Core.Metadata.Entry)\n- [2.48.0](/dotnet/docs/reference/Grpc.Core/2.48.0/Grpc.Core.Metadata.Entry) \n\n public class Metadata.Entry\n\nMetadata entry \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e Metadata.Entry \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.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) \n[object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals)\n\nNamespace\n---------\n\n[Grpc.Core](/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core)\n\nAssembly\n--------\n\nGrpc.Core.Api.dll\n\nConstructors\n------------\n\n### Entry(string, byte\\[\\])\n\n public Entry(string key, byte[] valueBytes)\n\nInitializes a new instance of the [Metadata.Entry](/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.Metadata.Entry) struct with a binary value.\n\n### Entry(string, string)\n\n public Entry(string key, string value)\n\nInitializes a new instance of the [Metadata.Entry](/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.Metadata.Entry) struct with an ASCII value.\n\nProperties\n----------\n\n### IsBinary\n\n public bool IsBinary { get; }\n\nReturns `true` if this entry is a binary-value entry.\n\n### Key\n\n public string Key { get; }\n\nGets the metadata entry key.\n\n### Value\n\n public string Value { get; }\n\nGets the string value of this metadata entry.\nIf the metadata entry is binary then an exception is thrown.\n\n### ValueBytes\n\n public byte[] ValueBytes { get; }\n\nGets the binary value of this metadata entry.\nIf the metadata entry is not binary the string value will be returned as ASCII encoded bytes.\n\nMethods\n-------\n\n### ToString()\n\n public override string ToString()\n\nReturns a [string](https://learn.microsoft.com/dotnet/api/system.string) that represents the current [Metadata.Entry](/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.Metadata.Entry).\n\n**Overrides** \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)"]]