This commit is contained in:
parent
d73dfd3a1d
commit
1599a5a2a7
|
|
@ -279,11 +279,27 @@ namespace Microsoft.AspNetCore.Http.Headers
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the value of header with <paramref name="name"/>.
|
||||
/// </summary>
|
||||
/// <remarks><typeparamref name="T"/> must contain a TryParse method with the signature <code>public static bool TryParse(string, out T)</code>.</remarks>
|
||||
/// <typeparam name="T">The type of the header.
|
||||
/// The given type must have a static TryParse method.</typeparam>
|
||||
/// <param name="name">The name of the header to retrieve.</param>
|
||||
/// <returns>The value of the header.</returns>
|
||||
public T Get<T>(string name)
|
||||
{
|
||||
return Headers.Get<T>(name);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the values of header with <paramref name="name"/>.
|
||||
/// </summary>
|
||||
/// <remarks><typeparamref name="T"/> must contain a TryParseList method with the signature <code>public static bool TryParseList(IList<string>, out IList<T>)</code>.</remarks>
|
||||
/// <typeparam name="T">The type of the header.
|
||||
/// The given type must have a static TryParseList method.</typeparam>
|
||||
/// <param name="name">The name of the header to retrieve.</param>
|
||||
/// <returns>List of values of the header.</returns>
|
||||
public IList<T> GetList<T>(string name)
|
||||
{
|
||||
return Headers.GetList<T>(name);
|
||||
|
|
|
|||
|
|
@ -158,11 +158,27 @@ namespace Microsoft.AspNetCore.Http.Headers
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the value of header with <paramref name="name"/>.
|
||||
/// </summary>
|
||||
/// <remarks><typeparamref name="T"/> must contain a TryParse method with the signature <code>public static bool TryParse(string, out T)</code>.</remarks>
|
||||
/// <typeparam name="T">The type of the header.
|
||||
/// The given type must have a static TryParse method.</typeparam>
|
||||
/// <param name="name">The name of the header to retrieve.</param>
|
||||
/// <returns>The value of the header.</returns>
|
||||
public T Get<T>(string name)
|
||||
{
|
||||
return Headers.Get<T>(name);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the values of header with <paramref name="name"/>.
|
||||
/// </summary>
|
||||
/// <remarks><typeparamref name="T"/> must contain a TryParseList method with the signature <code>public static bool TryParseList(IList<string>, out IList<T>)</code>.</remarks>
|
||||
/// <typeparam name="T">The type of the header.
|
||||
/// The given type must have a static TryParseList method.</typeparam>
|
||||
/// <param name="name">The name of the header to retrieve.</param>
|
||||
/// <returns>List of values of the header.</returns>
|
||||
public IList<T> GetList<T>(string name)
|
||||
{
|
||||
return Headers.GetList<T>(name);
|
||||
|
|
@ -208,4 +224,4 @@ namespace Microsoft.AspNetCore.Http.Headers
|
|||
Headers.AppendList<T>(name, values);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue