From 1599a5a2a791def8a23784756c303a914c0e1631 Mon Sep 17 00:00:00 2001 From: Koen Ekelschot Date: Wed, 16 Oct 2019 18:41:28 +0200 Subject: [PATCH] Improve documentation RequestHeaders and ResponseHeaders #3465 (#14971) --- src/Http/Http.Extensions/src/RequestHeaders.cs | 16 ++++++++++++++++ .../Http.Extensions/src/ResponseHeaders.cs | 18 +++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/src/Http/Http.Extensions/src/RequestHeaders.cs b/src/Http/Http.Extensions/src/RequestHeaders.cs index 12246922d4..94fa8149b9 100644 --- a/src/Http/Http.Extensions/src/RequestHeaders.cs +++ b/src/Http/Http.Extensions/src/RequestHeaders.cs @@ -279,11 +279,27 @@ namespace Microsoft.AspNetCore.Http.Headers } } + /// + /// Gets the value of header with . + /// + /// must contain a TryParse method with the signature public static bool TryParse(string, out T). + /// The type of the header. + /// The given type must have a static TryParse method. + /// The name of the header to retrieve. + /// The value of the header. public T Get(string name) { return Headers.Get(name); } + /// + /// Gets the values of header with . + /// + /// must contain a TryParseList method with the signature public static bool TryParseList(IList<string>, out IList<T>). + /// The type of the header. + /// The given type must have a static TryParseList method. + /// The name of the header to retrieve. + /// List of values of the header. public IList GetList(string name) { return Headers.GetList(name); diff --git a/src/Http/Http.Extensions/src/ResponseHeaders.cs b/src/Http/Http.Extensions/src/ResponseHeaders.cs index 87e3c0318c..2feff2fe3c 100644 --- a/src/Http/Http.Extensions/src/ResponseHeaders.cs +++ b/src/Http/Http.Extensions/src/ResponseHeaders.cs @@ -158,11 +158,27 @@ namespace Microsoft.AspNetCore.Http.Headers } } + /// + /// Gets the value of header with . + /// + /// must contain a TryParse method with the signature public static bool TryParse(string, out T). + /// The type of the header. + /// The given type must have a static TryParse method. + /// The name of the header to retrieve. + /// The value of the header. public T Get(string name) { return Headers.Get(name); } + /// + /// Gets the values of header with . + /// + /// must contain a TryParseList method with the signature public static bool TryParseList(IList<string>, out IList<T>). + /// The type of the header. + /// The given type must have a static TryParseList method. + /// The name of the header to retrieve. + /// List of values of the header. public IList GetList(string name) { return Headers.GetList(name); @@ -208,4 +224,4 @@ namespace Microsoft.AspNetCore.Http.Headers Headers.AppendList(name, values); } } -} \ No newline at end of file +}