|
|
|
@ -76,7 +76,7 @@ namespace Grpc.Core |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
/// Gets the last metadata entry with the specified key. If no entries have the key then <c>null</c> is returned. |
|
|
|
|
/// Gets the last metadata entry with the specified key. If there are no matching entries then <c>null</c> is returned. |
|
|
|
|
/// </summary> |
|
|
|
|
public Entry Get(string key) |
|
|
|
|
{ |
|
|
|
@ -92,33 +92,33 @@ namespace Grpc.Core |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
/// Gets all metadata entries with the specified key. |
|
|
|
|
/// Gets the string value of the last metadata entry with the specified key. If there are no matching entries then <c>null</c> is returned. |
|
|
|
|
/// </summary> |
|
|
|
|
public IEnumerable<Entry> GetAll(string key) |
|
|
|
|
public string GetValue(string key) |
|
|
|
|
{ |
|
|
|
|
for (int i = 0; i < entries.Count; i++) |
|
|
|
|
{ |
|
|
|
|
if (entries[i].Key == key) |
|
|
|
|
{ |
|
|
|
|
yield return entries[i]; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return Get(key)?.Value; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
/// Gets the last metadata entry string value with the specified key. If no entries have the key then <c>null</c> is returned. |
|
|
|
|
/// Gets the bytes value of the last metadata entry with the specified key. If there are no matching entries then <c>null</c> is returned. |
|
|
|
|
/// </summary> |
|
|
|
|
public string GetValue(string key) |
|
|
|
|
public byte[] GetValueBytes(string key) |
|
|
|
|
{ |
|
|
|
|
return Get(key)?.Value; |
|
|
|
|
return Get(key)?.ValueBytes; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
/// Gets the last metadata entry bytes value with the specified key. If no entries have the key then <c>null</c> is returned. |
|
|
|
|
/// Gets all metadata entries with the specified key. |
|
|
|
|
/// </summary> |
|
|
|
|
public byte[] GetValueBytes(string key) |
|
|
|
|
public IEnumerable<Entry> GetAll(string key) |
|
|
|
|
{ |
|
|
|
|
return Get(key)?.ValueBytes; |
|
|
|
|
for (int i = 0; i < entries.Count; i++) |
|
|
|
|
{ |
|
|
|
|
if (entries[i].Key == key) |
|
|
|
|
{ |
|
|
|
|
yield return entries[i]; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|