More doc comment additions (#11697)

More doc comment additions
This commit is contained in:
Ryan Brandenburg 2019-07-03 10:21:13 -07:00 committed by GitHub
parent 321db9d99f
commit 33eb8ba552
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 96 additions and 83 deletions

View File

@ -29,6 +29,7 @@ namespace Microsoft.AspNetCore.Antiforgery
/// Generates an <see cref="AntiforgeryTokenSet"/> for this request. /// Generates an <see cref="AntiforgeryTokenSet"/> for this request.
/// </summary> /// </summary>
/// <param name="httpContext">The <see cref="HttpContext"/> associated with the current request.</param> /// <param name="httpContext">The <see cref="HttpContext"/> associated with the current request.</param>
/// <returns>The <see cref="AntiforgeryTokenSet"/> for this request.</returns>
/// <remarks> /// <remarks>
/// Unlike <see cref="GetAndStoreTokens(HttpContext)"/>, this method has no side effect. The caller /// Unlike <see cref="GetAndStoreTokens(HttpContext)"/>, this method has no side effect. The caller
/// is responsible for setting the response cookie and injecting the returned /// is responsible for setting the response cookie and injecting the returned
@ -51,6 +52,7 @@ namespace Microsoft.AspNetCore.Antiforgery
/// Validates an antiforgery token that was supplied as part of the request. /// Validates an antiforgery token that was supplied as part of the request.
/// </summary> /// </summary>
/// <param name="httpContext">The <see cref="HttpContext"/> associated with the current request.</param> /// <param name="httpContext">The <see cref="HttpContext"/> associated with the current request.</param>
/// <returns>A <see cref="Task"/> that completes when validation has completed.</returns>
/// <exception cref="AntiforgeryValidationException"> /// <exception cref="AntiforgeryValidationException">
/// Thrown when the request does not include a valid antiforgery token. /// Thrown when the request does not include a valid antiforgery token.
/// </exception> /// </exception>

View File

@ -12,7 +12,8 @@ namespace Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.Configurat
/// Converts an <see cref="ISecret"/> to an &lt;masterKey&gt; element which is marked /// Converts an <see cref="ISecret"/> to an &lt;masterKey&gt; element which is marked
/// as requiring encryption. /// as requiring encryption.
/// </summary> /// </summary>
/// <returns></returns> /// <param name="secret">The secret for accessing the master key.</param>
/// <returns>The master key <see cref="XElement"/>.</returns>
public static XElement ToMasterKeyElement(this ISecret secret) public static XElement ToMasterKeyElement(this ISecret secret)
{ {
// Technically we'll be keeping the unprotected secret around in memory as // Technically we'll be keeping the unprotected secret around in memory as
@ -43,7 +44,7 @@ namespace Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.Configurat
/// <summary> /// <summary>
/// Converts a base64-encoded string into an <see cref="ISecret"/>. /// Converts a base64-encoded string into an <see cref="ISecret"/>.
/// </summary> /// </summary>
/// <returns></returns> /// <returns>The <see cref="Secret"/>.</returns>
public static Secret ToSecret(this string base64String) public static Secret ToSecret(this string base64String)
{ {
byte[] unprotectedSecret = Convert.FromBase64String(base64String); byte[] unprotectedSecret = Convert.FromBase64String(base64String);

View File

@ -21,7 +21,7 @@ namespace Microsoft.Extensions.Hosting
/// </remarks> /// </remarks>
/// <param name="builder">The <see cref="IHostBuilder" /> instance to configure</param> /// <param name="builder">The <see cref="IHostBuilder" /> instance to configure</param>
/// <param name="configure">The configure callback</param> /// <param name="configure">The configure callback</param>
/// <returns></returns> /// <returns>The <see cref="IHostBuilder"/> for chaining.</returns>
public static IHostBuilder ConfigureWebHostDefaults(this IHostBuilder builder, Action<IWebHostBuilder> configure) public static IHostBuilder ConfigureWebHostDefaults(this IHostBuilder builder, Action<IWebHostBuilder> configure)
{ {
return builder.ConfigureWebHost(webHostBuilder => return builder.ConfigureWebHost(webHostBuilder =>

View File

@ -52,7 +52,7 @@ namespace Microsoft.AspNetCore.JsonPatch
/// </summary> /// </summary>
/// <param name="path">target location</param> /// <param name="path">target location</param>
/// <param name="value">value</param> /// <param name="value">value</param>
/// <returns></returns> /// <returns>The <see cref="JsonPatchDocument"/> for chaining.</returns>
public JsonPatchDocument Add(string path, object value) public JsonPatchDocument Add(string path, object value)
{ {
if (path == null) if (path == null)
@ -69,7 +69,7 @@ namespace Microsoft.AspNetCore.JsonPatch
/// { "op": "remove", "path": "/a/b/c" } /// { "op": "remove", "path": "/a/b/c" }
/// </summary> /// </summary>
/// <param name="path">target location</param> /// <param name="path">target location</param>
/// <returns></returns> /// <returns>The <see cref="JsonPatchDocument"/> for chaining.</returns>
public JsonPatchDocument Remove(string path) public JsonPatchDocument Remove(string path)
{ {
if (path == null) if (path == null)
@ -87,7 +87,7 @@ namespace Microsoft.AspNetCore.JsonPatch
/// </summary> /// </summary>
/// <param name="path">target location</param> /// <param name="path">target location</param>
/// <param name="value">value</param> /// <param name="value">value</param>
/// <returns></returns> /// <returns>The <see cref="JsonPatchDocument"/> for chaining.</returns>
public JsonPatchDocument Replace(string path, object value) public JsonPatchDocument Replace(string path, object value)
{ {
if (path == null) if (path == null)
@ -105,7 +105,7 @@ namespace Microsoft.AspNetCore.JsonPatch
/// </summary> /// </summary>
/// <param name="path">target location</param> /// <param name="path">target location</param>
/// <param name="value">value</param> /// <param name="value">value</param>
/// <returns></returns> /// <returns>The <see cref="JsonPatchDocument"/> for chaining.</returns>
public JsonPatchDocument Test(string path, object value) public JsonPatchDocument Test(string path, object value)
{ {
if (path == null) if (path == null)
@ -123,7 +123,7 @@ namespace Microsoft.AspNetCore.JsonPatch
/// </summary> /// </summary>
/// <param name="from">source location</param> /// <param name="from">source location</param>
/// <param name="path">target location</param> /// <param name="path">target location</param>
/// <returns></returns> /// <returns>The <see cref="JsonPatchDocument"/> for chaining.</returns>
public JsonPatchDocument Move(string from, string path) public JsonPatchDocument Move(string from, string path)
{ {
if (from == null) if (from == null)
@ -146,7 +146,7 @@ namespace Microsoft.AspNetCore.JsonPatch
/// </summary> /// </summary>
/// <param name="from">source location</param> /// <param name="from">source location</param>
/// <param name="path">target location</param> /// <param name="path">target location</param>
/// <returns></returns> /// <returns>The <see cref="JsonPatchDocument"/> for chaining.</returns>
public JsonPatchDocument Copy(string from, string path) public JsonPatchDocument Copy(string from, string path)
{ {
if (from == null) if (from == null)

View File

@ -48,7 +48,7 @@ namespace Microsoft.AspNetCore.JsonPatch
/// <typeparam name="TProp">value type</typeparam> /// <typeparam name="TProp">value type</typeparam>
/// <param name="path">target location</param> /// <param name="path">target location</param>
/// <param name="value">value</param> /// <param name="value">value</param>
/// <returns></returns> /// <returns>The <see cref="JsonPatchDocument{TModel}"/> for chaining.</returns>
public JsonPatchDocument<TModel> Add<TProp>(Expression<Func<TModel, TProp>> path, TProp value) public JsonPatchDocument<TModel> Add<TProp>(Expression<Func<TModel, TProp>> path, TProp value)
{ {
if (path == null) if (path == null)
@ -72,7 +72,7 @@ namespace Microsoft.AspNetCore.JsonPatch
/// <param name="path">target location</param> /// <param name="path">target location</param>
/// <param name="value">value</param> /// <param name="value">value</param>
/// <param name="position">position</param> /// <param name="position">position</param>
/// <returns></returns> /// <returns>The <see cref="JsonPatchDocument{TModel}"/> for chaining.</returns>
public JsonPatchDocument<TModel> Add<TProp>( public JsonPatchDocument<TModel> Add<TProp>(
Expression<Func<TModel, IList<TProp>>> path, Expression<Func<TModel, IList<TProp>>> path,
TProp value, TProp value,
@ -98,7 +98,7 @@ namespace Microsoft.AspNetCore.JsonPatch
/// <typeparam name="TProp">value type</typeparam> /// <typeparam name="TProp">value type</typeparam>
/// <param name="path">target location</param> /// <param name="path">target location</param>
/// <param name="value">value</param> /// <param name="value">value</param>
/// <returns></returns> /// <returns>The <see cref="JsonPatchDocument{TModel}"/> for chaining.</returns>
public JsonPatchDocument<TModel> Add<TProp>(Expression<Func<TModel, IList<TProp>>> path, TProp value) public JsonPatchDocument<TModel> Add<TProp>(Expression<Func<TModel, IList<TProp>>> path, TProp value)
{ {
if (path == null) if (path == null)
@ -120,7 +120,7 @@ namespace Microsoft.AspNetCore.JsonPatch
/// { "op": "remove", "path": "/a/b/c" } /// { "op": "remove", "path": "/a/b/c" }
/// </summary> /// </summary>
/// <param name="path">target location</param> /// <param name="path">target location</param>
/// <returns></returns> /// <returns>The <see cref="JsonPatchDocument{TModel}"/> for chaining.</returns>
public JsonPatchDocument<TModel> Remove<TProp>(Expression<Func<TModel, TProp>> path) public JsonPatchDocument<TModel> Remove<TProp>(Expression<Func<TModel, TProp>> path)
{ {
if (path == null) if (path == null)
@ -139,7 +139,7 @@ namespace Microsoft.AspNetCore.JsonPatch
/// <typeparam name="TProp">value type</typeparam> /// <typeparam name="TProp">value type</typeparam>
/// <param name="path">target location</param> /// <param name="path">target location</param>
/// <param name="position">position</param> /// <param name="position">position</param>
/// <returns></returns> /// <returns>The <see cref="JsonPatchDocument{TModel}"/> for chaining.</returns>
public JsonPatchDocument<TModel> Remove<TProp>(Expression<Func<TModel, IList<TProp>>> path, int position) public JsonPatchDocument<TModel> Remove<TProp>(Expression<Func<TModel, IList<TProp>>> path, int position)
{ {
if (path == null) if (path == null)
@ -160,7 +160,7 @@ namespace Microsoft.AspNetCore.JsonPatch
/// </summary> /// </summary>
/// <typeparam name="TProp">value type</typeparam> /// <typeparam name="TProp">value type</typeparam>
/// <param name="path">target location</param> /// <param name="path">target location</param>
/// <returns></returns> /// <returns>The <see cref="JsonPatchDocument{TModel}"/> for chaining.</returns>
public JsonPatchDocument<TModel> Remove<TProp>(Expression<Func<TModel, IList<TProp>>> path) public JsonPatchDocument<TModel> Remove<TProp>(Expression<Func<TModel, IList<TProp>>> path)
{ {
if (path == null) if (path == null)
@ -182,7 +182,7 @@ namespace Microsoft.AspNetCore.JsonPatch
/// </summary> /// </summary>
/// <param name="path">target location</param> /// <param name="path">target location</param>
/// <param name="value">value</param> /// <param name="value">value</param>
/// <returns></returns> /// <returns>The <see cref="JsonPatchDocument{TModel}"/> for chaining.</returns>
public JsonPatchDocument<TModel> Replace<TProp>(Expression<Func<TModel, TProp>> path, TProp value) public JsonPatchDocument<TModel> Replace<TProp>(Expression<Func<TModel, TProp>> path, TProp value)
{ {
if (path == null) if (path == null)
@ -206,7 +206,7 @@ namespace Microsoft.AspNetCore.JsonPatch
/// <param name="path">target location</param> /// <param name="path">target location</param>
/// <param name="value">value</param> /// <param name="value">value</param>
/// <param name="position">position</param> /// <param name="position">position</param>
/// <returns></returns> /// <returns>The <see cref="JsonPatchDocument{TModel}"/> for chaining.</returns>
public JsonPatchDocument<TModel> Replace<TProp>(Expression<Func<TModel, IList<TProp>>> path, public JsonPatchDocument<TModel> Replace<TProp>(Expression<Func<TModel, IList<TProp>>> path,
TProp value, int position) TProp value, int position)
{ {
@ -230,7 +230,7 @@ namespace Microsoft.AspNetCore.JsonPatch
/// <typeparam name="TProp">value type</typeparam> /// <typeparam name="TProp">value type</typeparam>
/// <param name="path">target location</param> /// <param name="path">target location</param>
/// <param name="value">value</param> /// <param name="value">value</param>
/// <returns></returns> /// <returns>The <see cref="JsonPatchDocument{TModel}"/> for chaining.</returns>
public JsonPatchDocument<TModel> Replace<TProp>(Expression<Func<TModel, IList<TProp>>> path, TProp value) public JsonPatchDocument<TModel> Replace<TProp>(Expression<Func<TModel, IList<TProp>>> path, TProp value)
{ {
if (path == null) if (path == null)
@ -253,7 +253,7 @@ namespace Microsoft.AspNetCore.JsonPatch
/// </summary> /// </summary>
/// <param name="path">target location</param> /// <param name="path">target location</param>
/// <param name="value">value</param> /// <param name="value">value</param>
/// <returns></returns> /// <returns>The <see cref="JsonPatchDocument{TModel}"/> for chaining.</returns>
public JsonPatchDocument<TModel> Test<TProp>(Expression<Func<TModel, TProp>> path, TProp value) public JsonPatchDocument<TModel> Test<TProp>(Expression<Func<TModel, TProp>> path, TProp value)
{ {
if (path == null) if (path == null)
@ -277,7 +277,7 @@ namespace Microsoft.AspNetCore.JsonPatch
/// <param name="path">target location</param> /// <param name="path">target location</param>
/// <param name="value">value</param> /// <param name="value">value</param>
/// <param name="position">position</param> /// <param name="position">position</param>
/// <returns></returns> /// <returns>The <see cref="JsonPatchDocument{TModel}"/> for chaining.</returns>
public JsonPatchDocument<TModel> Test<TProp>(Expression<Func<TModel, IList<TProp>>> path, public JsonPatchDocument<TModel> Test<TProp>(Expression<Func<TModel, IList<TProp>>> path,
TProp value, int position) TProp value, int position)
{ {
@ -301,7 +301,7 @@ namespace Microsoft.AspNetCore.JsonPatch
/// <typeparam name="TProp">value type</typeparam> /// <typeparam name="TProp">value type</typeparam>
/// <param name="path">target location</param> /// <param name="path">target location</param>
/// <param name="value">value</param> /// <param name="value">value</param>
/// <returns></returns> /// <returns>The <see cref="JsonPatchDocument{TModel}"/> for chaining.</returns>
public JsonPatchDocument<TModel> Test<TProp>(Expression<Func<TModel, IList<TProp>>> path, TProp value) public JsonPatchDocument<TModel> Test<TProp>(Expression<Func<TModel, IList<TProp>>> path, TProp value)
{ {
if (path == null) if (path == null)
@ -324,7 +324,7 @@ namespace Microsoft.AspNetCore.JsonPatch
/// </summary> /// </summary>
/// <param name="from">source location</param> /// <param name="from">source location</param>
/// <param name="path">target location</param> /// <param name="path">target location</param>
/// <returns></returns> /// <returns>The <see cref="JsonPatchDocument{TModel}"/> for chaining.</returns>
public JsonPatchDocument<TModel> Move<TProp>( public JsonPatchDocument<TModel> Move<TProp>(
Expression<Func<TModel, TProp>> from, Expression<Func<TModel, TProp>> from,
Expression<Func<TModel, TProp>> path) Expression<Func<TModel, TProp>> path)
@ -354,7 +354,7 @@ namespace Microsoft.AspNetCore.JsonPatch
/// <param name="from">source location</param> /// <param name="from">source location</param>
/// <param name="positionFrom">position</param> /// <param name="positionFrom">position</param>
/// <param name="path">target location</param> /// <param name="path">target location</param>
/// <returns></returns> /// <returns>The <see cref="JsonPatchDocument{TModel}"/> for chaining.</returns>
public JsonPatchDocument<TModel> Move<TProp>( public JsonPatchDocument<TModel> Move<TProp>(
Expression<Func<TModel, IList<TProp>>> from, Expression<Func<TModel, IList<TProp>>> from,
int positionFrom, int positionFrom,
@ -385,7 +385,7 @@ namespace Microsoft.AspNetCore.JsonPatch
/// <param name="from">source location</param> /// <param name="from">source location</param>
/// <param name="path">target location</param> /// <param name="path">target location</param>
/// <param name="positionTo">position</param> /// <param name="positionTo">position</param>
/// <returns></returns> /// <returns>The <see cref="JsonPatchDocument{TModel}"/> for chaining.</returns>
public JsonPatchDocument<TModel> Move<TProp>( public JsonPatchDocument<TModel> Move<TProp>(
Expression<Func<TModel, TProp>> from, Expression<Func<TModel, TProp>> from,
Expression<Func<TModel, IList<TProp>>> path, Expression<Func<TModel, IList<TProp>>> path,
@ -417,7 +417,7 @@ namespace Microsoft.AspNetCore.JsonPatch
/// <param name="positionFrom">position (source)</param> /// <param name="positionFrom">position (source)</param>
/// <param name="path">target location</param> /// <param name="path">target location</param>
/// <param name="positionTo">position (target)</param> /// <param name="positionTo">position (target)</param>
/// <returns></returns> /// <returns>The <see cref="JsonPatchDocument{TModel}"/> for chaining.</returns>
public JsonPatchDocument<TModel> Move<TProp>( public JsonPatchDocument<TModel> Move<TProp>(
Expression<Func<TModel, IList<TProp>>> from, Expression<Func<TModel, IList<TProp>>> from,
int positionFrom, int positionFrom,
@ -449,7 +449,7 @@ namespace Microsoft.AspNetCore.JsonPatch
/// <param name="from">source location</param> /// <param name="from">source location</param>
/// <param name="positionFrom">position</param> /// <param name="positionFrom">position</param>
/// <param name="path">target location</param> /// <param name="path">target location</param>
/// <returns></returns> /// <returns>The <see cref="JsonPatchDocument{TModel}"/> for chaining.</returns>
public JsonPatchDocument<TModel> Move<TProp>( public JsonPatchDocument<TModel> Move<TProp>(
Expression<Func<TModel, IList<TProp>>> from, Expression<Func<TModel, IList<TProp>>> from,
int positionFrom, int positionFrom,
@ -479,7 +479,7 @@ namespace Microsoft.AspNetCore.JsonPatch
/// <typeparam name="TProp"></typeparam> /// <typeparam name="TProp"></typeparam>
/// <param name="from">source location</param> /// <param name="from">source location</param>
/// <param name="path">target location</param> /// <param name="path">target location</param>
/// <returns></returns> /// <returns>The <see cref="JsonPatchDocument{TModel}"/> for chaining.</returns>
public JsonPatchDocument<TModel> Move<TProp>( public JsonPatchDocument<TModel> Move<TProp>(
Expression<Func<TModel, TProp>> from, Expression<Func<TModel, TProp>> from,
Expression<Func<TModel, IList<TProp>>> path) Expression<Func<TModel, IList<TProp>>> path)
@ -508,7 +508,7 @@ namespace Microsoft.AspNetCore.JsonPatch
/// </summary> /// </summary>
/// <param name="from">source location</param> /// <param name="from">source location</param>
/// <param name="path">target location</param> /// <param name="path">target location</param>
/// <returns></returns> /// <returns>The <see cref="JsonPatchDocument{TModel}"/> for chaining.</returns>
public JsonPatchDocument<TModel> Copy<TProp>( public JsonPatchDocument<TModel> Copy<TProp>(
Expression<Func<TModel, TProp>> from, Expression<Func<TModel, TProp>> from,
Expression<Func<TModel, TProp>> path) Expression<Func<TModel, TProp>> path)
@ -538,7 +538,7 @@ namespace Microsoft.AspNetCore.JsonPatch
/// <param name="from">source location</param> /// <param name="from">source location</param>
/// <param name="positionFrom">position</param> /// <param name="positionFrom">position</param>
/// <param name="path">target location</param> /// <param name="path">target location</param>
/// <returns></returns> /// <returns>The <see cref="JsonPatchDocument{TModel}"/> for chaining.</returns>
public JsonPatchDocument<TModel> Copy<TProp>( public JsonPatchDocument<TModel> Copy<TProp>(
Expression<Func<TModel, IList<TProp>>> from, Expression<Func<TModel, IList<TProp>>> from,
int positionFrom, int positionFrom,
@ -569,7 +569,7 @@ namespace Microsoft.AspNetCore.JsonPatch
/// <param name="from">source location</param> /// <param name="from">source location</param>
/// <param name="path">target location</param> /// <param name="path">target location</param>
/// <param name="positionTo">position</param> /// <param name="positionTo">position</param>
/// <returns></returns> /// <returns>The <see cref="JsonPatchDocument{TModel}"/> for chaining.</returns>
public JsonPatchDocument<TModel> Copy<TProp>( public JsonPatchDocument<TModel> Copy<TProp>(
Expression<Func<TModel, TProp>> from, Expression<Func<TModel, TProp>> from,
Expression<Func<TModel, IList<TProp>>> path, Expression<Func<TModel, IList<TProp>>> path,
@ -601,7 +601,7 @@ namespace Microsoft.AspNetCore.JsonPatch
/// <param name="positionFrom">position (source)</param> /// <param name="positionFrom">position (source)</param>
/// <param name="path">target location</param> /// <param name="path">target location</param>
/// <param name="positionTo">position (target)</param> /// <param name="positionTo">position (target)</param>
/// <returns></returns> /// <returns>The <see cref="JsonPatchDocument{TModel}"/> for chaining.</returns>
public JsonPatchDocument<TModel> Copy<TProp>( public JsonPatchDocument<TModel> Copy<TProp>(
Expression<Func<TModel, IList<TProp>>> from, Expression<Func<TModel, IList<TProp>>> from,
int positionFrom, int positionFrom,
@ -633,7 +633,7 @@ namespace Microsoft.AspNetCore.JsonPatch
/// <param name="from">source location</param> /// <param name="from">source location</param>
/// <param name="positionFrom">position</param> /// <param name="positionFrom">position</param>
/// <param name="path">target location</param> /// <param name="path">target location</param>
/// <returns></returns> /// <returns>The <see cref="JsonPatchDocument{TModel}"/> for chaining.</returns>
public JsonPatchDocument<TModel> Copy<TProp>( public JsonPatchDocument<TModel> Copy<TProp>(
Expression<Func<TModel, IList<TProp>>> from, Expression<Func<TModel, IList<TProp>>> from,
int positionFrom, int positionFrom,
@ -663,7 +663,7 @@ namespace Microsoft.AspNetCore.JsonPatch
/// <typeparam name="TProp"></typeparam> /// <typeparam name="TProp"></typeparam>
/// <param name="from">source location</param> /// <param name="from">source location</param>
/// <param name="path">target location</param> /// <param name="path">target location</param>
/// <returns></returns> /// <returns>The <see cref="JsonPatchDocument{TModel}"/> for chaining.</returns>
public JsonPatchDocument<TModel> Copy<TProp>( public JsonPatchDocument<TModel> Copy<TProp>(
Expression<Func<TModel, TProp>> from, Expression<Func<TModel, TProp>> from,
Expression<Func<TModel, IList<TProp>>> path) Expression<Func<TModel, IList<TProp>>> path)
@ -868,7 +868,7 @@ namespace Microsoft.AspNetCore.JsonPatch
} }
// Evaluates the value of the key or index which may be an int or a string, // Evaluates the value of the key or index which may be an int or a string,
// or some other expression type. // or some other expression type.
// The expression is converted to a delegate and the result of executing the delegate is returned as a string. // The expression is converted to a delegate and the result of executing the delegate is returned as a string.
private static string EvaluateExpression(Expression expression) private static string EvaluateExpression(Expression expression)
@ -881,4 +881,4 @@ namespace Microsoft.AspNetCore.JsonPatch
return Convert.ToString(func(null), CultureInfo.InvariantCulture); return Convert.ToString(func(null), CultureInfo.InvariantCulture);
} }
} }
} }

View File

@ -31,13 +31,15 @@ namespace Microsoft.AspNetCore.Hosting
/// <summary> /// <summary>
/// Starts listening on the configured addresses. /// Starts listening on the configured addresses.
/// </summary> /// </summary>
/// <param name="cancellationToken">Used to abort program start.</param>
/// <returns>A <see cref="Task"/> that completes when the <see cref="IWebHost"/> starts.</returns>
Task StartAsync(CancellationToken cancellationToken = default); Task StartAsync(CancellationToken cancellationToken = default);
/// <summary> /// <summary>
/// Attempt to gracefully stop the host. /// Attempt to gracefully stop the host.
/// </summary> /// </summary>
/// <param name="cancellationToken"></param> /// <param name="cancellationToken">Used to indicate when stop should no longer be graceful.</param>
/// <returns></returns> /// <returns>A <see cref="Task"/> that completes when the <see cref="IWebHost"/> stops.</returns>
Task StopAsync(CancellationToken cancellationToken = default); Task StopAsync(CancellationToken cancellationToken = default);
} }
} }

View File

@ -18,7 +18,7 @@ namespace Microsoft.AspNetCore.Hosting
/// <param name="host"></param> /// <param name="host"></param>
/// <param name="timeout">The timeout for stopping gracefully. Once expired the /// <param name="timeout">The timeout for stopping gracefully. Once expired the
/// server may terminate any remaining active connections.</param> /// server may terminate any remaining active connections.</param>
/// <returns></returns> /// <returns>A <see cref="Task"/> that completes when the <see cref="IWebHost"/> stops.</returns>
public static Task StopAsync(this IWebHost host, TimeSpan timeout) public static Task StopAsync(this IWebHost host, TimeSpan timeout)
{ {
return host.StopAsync(new CancellationTokenSource(timeout).Token); return host.StopAsync(new CancellationTokenSource(timeout).Token);
@ -38,6 +38,7 @@ namespace Microsoft.AspNetCore.Hosting
/// </summary> /// </summary>
/// <param name="host">The running <see cref="IWebHost"/>.</param> /// <param name="host">The running <see cref="IWebHost"/>.</param>
/// <param name="token">The token to trigger shutdown.</param> /// <param name="token">The token to trigger shutdown.</param>
/// <returns>A <see cref="Task"/> that completes when shutdown is triggered via Ctrl+C or SIGTERM.</returns>
public static async Task WaitForShutdownAsync(this IWebHost host, CancellationToken token = default) public static async Task WaitForShutdownAsync(this IWebHost host, CancellationToken token = default)
{ {
var done = new ManualResetEventSlim(false); var done = new ManualResetEventSlim(false);

View File

@ -35,7 +35,7 @@ namespace Microsoft.AspNetCore.TestHost
/// Configure any HttpRequestMessage properties. /// Configure any HttpRequestMessage properties.
/// </summary> /// </summary>
/// <param name="configure"></param> /// <param name="configure"></param>
/// <returns></returns> /// <returns>This <see cref="RequestBuilder"/> for chaining.</returns>
public RequestBuilder And(Action<HttpRequestMessage> configure) public RequestBuilder And(Action<HttpRequestMessage> configure)
{ {
if (configure == null) if (configure == null)
@ -52,7 +52,7 @@ namespace Microsoft.AspNetCore.TestHost
/// </summary> /// </summary>
/// <param name="name"></param> /// <param name="name"></param>
/// <param name="value"></param> /// <param name="value"></param>
/// <returns></returns> /// <returns>This <see cref="RequestBuilder"/> for chaining.</returns>
public RequestBuilder AddHeader(string name, string value) public RequestBuilder AddHeader(string name, string value)
{ {
if (!_req.Headers.TryAddWithoutValidation(name, value)) if (!_req.Headers.TryAddWithoutValidation(name, value))
@ -74,7 +74,7 @@ namespace Microsoft.AspNetCore.TestHost
/// Set the request method and start processing the request. /// Set the request method and start processing the request.
/// </summary> /// </summary>
/// <param name="method"></param> /// <param name="method"></param>
/// <returns></returns> /// <returns>The resulting <see cref="HttpResponseMessage"/>.</returns>
public Task<HttpResponseMessage> SendAsync(string method) public Task<HttpResponseMessage> SendAsync(string method)
{ {
_req.Method = new HttpMethod(method); _req.Method = new HttpMethod(method);
@ -84,7 +84,7 @@ namespace Microsoft.AspNetCore.TestHost
/// <summary> /// <summary>
/// Set the request method to GET and start processing the request. /// Set the request method to GET and start processing the request.
/// </summary> /// </summary>
/// <returns></returns> /// <returns>The resulting <see cref="HttpResponseMessage"/>.</returns>
public Task<HttpResponseMessage> GetAsync() public Task<HttpResponseMessage> GetAsync()
{ {
_req.Method = HttpMethod.Get; _req.Method = HttpMethod.Get;
@ -94,7 +94,7 @@ namespace Microsoft.AspNetCore.TestHost
/// <summary> /// <summary>
/// Set the request method to POST and start processing the request. /// Set the request method to POST and start processing the request.
/// </summary> /// </summary>
/// <returns></returns> /// <returns>The resulting <see cref="HttpResponseMessage"/>.</returns>
public Task<HttpResponseMessage> PostAsync() public Task<HttpResponseMessage> PostAsync()
{ {
_req.Method = HttpMethod.Post; _req.Method = HttpMethod.Post;

View File

@ -11,6 +11,9 @@ namespace Microsoft.AspNetCore.Authentication
/// </summary> /// </summary>
public class AuthenticateResult public class AuthenticateResult
{ {
/// <summary>
/// Creates a new <see cref="AuthenticateResult"/> instance.
/// </summary>
protected AuthenticateResult() { } protected AuthenticateResult() { }
/// <summary> /// <summary>

View File

@ -171,7 +171,7 @@ namespace Microsoft.AspNetCore.Authentication
/// <param name="context">The <see cref="HttpContext"/> context.</param> /// <param name="context">The <see cref="HttpContext"/> context.</param>
/// <param name="scheme">The name of the authentication scheme.</param> /// <param name="scheme">The name of the authentication scheme.</param>
/// <param name="properties">The <see cref="AuthenticationProperties"/> properties.</param> /// <param name="properties">The <see cref="AuthenticationProperties"/> properties.</param>
/// <returns></returns> /// <returns>The task.</returns>
public static Task SignOutAsync(this HttpContext context, string scheme, AuthenticationProperties properties) => public static Task SignOutAsync(this HttpContext context, string scheme, AuthenticationProperties properties) =>
context.RequestServices.GetRequiredService<IAuthenticationService>().SignOutAsync(context, scheme, properties); context.RequestServices.GetRequiredService<IAuthenticationService>().SignOutAsync(context, scheme, properties);

View File

@ -13,7 +13,7 @@ namespace Microsoft.AspNetCore.Authentication
/// <summary> /// <summary>
/// Returns true if request processing should stop. /// Returns true if request processing should stop.
/// </summary> /// </summary>
/// <returns></returns> /// <returns><code>true</code> if request processing should stop.</returns>
Task<bool> HandleRequestAsync(); Task<bool> HandleRequestAsync();
} }

View File

@ -51,7 +51,7 @@ namespace Microsoft.AspNetCore.Http
&& host.IndexOf(':', index + 1) >= 0) && host.IndexOf(':', index + 1) >= 0)
{ {
// IPv6 without brackets ::1 is the only type of host with 2 or more colons // IPv6 without brackets ::1 is the only type of host with 2 or more colons
host = $"[{host}]"; host = $"[{host}]";
} }
_value = host + ":" + port.ToString(CultureInfo.InvariantCulture); _value = host + ":" + port.ToString(CultureInfo.InvariantCulture);
@ -74,7 +74,7 @@ namespace Microsoft.AspNetCore.Http
/// Returns the value of the host part of the value. The port is removed if it was present. /// Returns the value of the host part of the value. The port is removed if it was present.
/// IPv6 addresses will have brackets added if they are missing. /// IPv6 addresses will have brackets added if they are missing.
/// </summary> /// </summary>
/// <returns></returns> /// <returns>The host portion of the value.</returns>
public string Host public string Host
{ {
get get
@ -88,7 +88,7 @@ namespace Microsoft.AspNetCore.Http
/// <summary> /// <summary>
/// Returns the value of the port part of the host, or <value>null</value> if none is found. /// Returns the value of the port part of the host, or <value>null</value> if none is found.
/// </summary> /// </summary>
/// <returns></returns> /// <returns>The port portion of the value.</returns>
public int? Port public int? Port
{ {
get get
@ -108,7 +108,7 @@ namespace Microsoft.AspNetCore.Http
/// <summary> /// <summary>
/// Returns the value as normalized by ToUriComponent(). /// Returns the value as normalized by ToUriComponent().
/// </summary> /// </summary>
/// <returns></returns> /// <returns>The value as normalized by <see cref="ToUriComponent"/>.</returns>
public override string ToString() public override string ToString()
{ {
return ToUriComponent(); return ToUriComponent();
@ -118,7 +118,7 @@ namespace Microsoft.AspNetCore.Http
/// Returns the value properly formatted and encoded for use in a URI in a HTTP header. /// Returns the value properly formatted and encoded for use in a URI in a HTTP header.
/// Any Unicode is converted to punycode. IPv6 addresses will have brackets added if they are missing. /// Any Unicode is converted to punycode. IPv6 addresses will have brackets added if they are missing.
/// </summary> /// </summary>
/// <returns></returns> /// <returns>The <see cref="HostString"/> value formated for use in a URI or HTTP header.</returns>
public string ToUriComponent() public string ToUriComponent()
{ {
if (string.IsNullOrEmpty(_value)) if (string.IsNullOrEmpty(_value))
@ -154,8 +154,8 @@ namespace Microsoft.AspNetCore.Http
/// Creates a new HostString from the given URI component. /// Creates a new HostString from the given URI component.
/// Any punycode will be converted to Unicode. /// Any punycode will be converted to Unicode.
/// </summary> /// </summary>
/// <param name="uriComponent"></param> /// <param name="uriComponent">The URI component string to create a <see cref="HostString"/> from.</param>
/// <returns></returns> /// <returns>The <see cref="HostString"/> that was created.</returns>
public static HostString FromUriComponent(string uriComponent) public static HostString FromUriComponent(string uriComponent)
{ {
if (!string.IsNullOrEmpty(uriComponent)) if (!string.IsNullOrEmpty(uriComponent))
@ -195,8 +195,8 @@ namespace Microsoft.AspNetCore.Http
/// Creates a new HostString from the host and port of the give Uri instance. /// Creates a new HostString from the host and port of the give Uri instance.
/// Punycode will be converted to Unicode. /// Punycode will be converted to Unicode.
/// </summary> /// </summary>
/// <param name="uri"></param> /// <param name="uri">The <see cref="Uri"/> to create a <see cref="HostString"/> from.</param>
/// <returns></returns> /// <returns>The <see cref="HostString"/> that was created.</returns>
public static HostString FromUriComponent(Uri uri) public static HostString FromUriComponent(Uri uri)
{ {
if (uri == null) if (uri == null)
@ -223,7 +223,7 @@ namespace Microsoft.AspNetCore.Http
/// "abc.example.com:443" but not "example.com:443". /// "abc.example.com:443" but not "example.com:443".
/// Matching is case insensitive. /// Matching is case insensitive.
/// </remarks> /// </remarks>
/// <returns></returns> /// <returns><code>true</code> if <paramref name="value"/> matches any of the patterns.</returns>
public static bool MatchesAny(StringSegment value, IList<StringSegment> patterns) public static bool MatchesAny(StringSegment value, IList<StringSegment> patterns)
{ {
if (value == null) if (value == null)
@ -281,8 +281,8 @@ namespace Microsoft.AspNetCore.Http
/// <summary> /// <summary>
/// Compares the equality of the Value property, ignoring case. /// Compares the equality of the Value property, ignoring case.
/// </summary> /// </summary>
/// <param name="other"></param> /// <param name="other">The <see cref="HostString"/> to compare against.</param>
/// <returns></returns> /// <returns><code>true</code> if they have the same value.</returns>
public bool Equals(HostString other) public bool Equals(HostString other)
{ {
if (!HasValue && !other.HasValue) if (!HasValue && !other.HasValue)
@ -295,8 +295,8 @@ namespace Microsoft.AspNetCore.Http
/// <summary> /// <summary>
/// Compares against the given object only if it is a HostString. /// Compares against the given object only if it is a HostString.
/// </summary> /// </summary>
/// <param name="obj"></param> /// <param name="obj">The <see cref="object"/> to compare against.</param>
/// <returns></returns> /// <returns><code>true</code> if they have the same value.</returns>
public override bool Equals(object obj) public override bool Equals(object obj)
{ {
if (ReferenceEquals(null, obj)) if (ReferenceEquals(null, obj))
@ -309,7 +309,7 @@ namespace Microsoft.AspNetCore.Http
/// <summary> /// <summary>
/// Gets a hash code for the value. /// Gets a hash code for the value.
/// </summary> /// </summary>
/// <returns></returns> /// <returns>The hash code as an <see cref="int"/>.</returns>
public override int GetHashCode() public override int GetHashCode()
{ {
return (HasValue ? StringComparer.OrdinalIgnoreCase.GetHashCode(_value) : 0); return (HasValue ? StringComparer.OrdinalIgnoreCase.GetHashCode(_value) : 0);
@ -318,9 +318,9 @@ namespace Microsoft.AspNetCore.Http
/// <summary> /// <summary>
/// Compares the two instances for equality. /// Compares the two instances for equality.
/// </summary> /// </summary>
/// <param name="left"></param> /// <param name="left">The left parameter.</param>
/// <param name="right"></param> /// <param name="right">The right parameter.</param>
/// <returns></returns> /// <returns><code>true</code> if both <see cref="HostString"/>'s have the same value.</returns>
public static bool operator ==(HostString left, HostString right) public static bool operator ==(HostString left, HostString right)
{ {
return left.Equals(right); return left.Equals(right);
@ -329,9 +329,9 @@ namespace Microsoft.AspNetCore.Http
/// <summary> /// <summary>
/// Compares the two instances for inequality. /// Compares the two instances for inequality.
/// </summary> /// </summary>
/// <param name="left"></param> /// <param name="left">The left parameter.</param>
/// <param name="right"></param> /// <param name="right">The right parameter.</param>
/// <returns></returns> /// <returns><code>true</code> if both <see cref="HostString"/>'s values are not equal.</returns>
public static bool operator !=(HostString left, HostString right) public static bool operator !=(HostString left, HostString right)
{ {
return !left.Equals(right); return !left.Equals(right);
@ -340,6 +340,9 @@ namespace Microsoft.AspNetCore.Http
/// <summary> /// <summary>
/// Parses the current value. IPv6 addresses will have brackets added if they are missing. /// Parses the current value. IPv6 addresses will have brackets added if they are missing.
/// </summary> /// </summary>
/// <param name="value">The value to get the parts of.</param>
/// <param name="host">The portion of the <paramref name="value"/> which represents the host.</param>
/// <param name="port">The portion of the <paramref name="value"/> which represents the port.</param>
private static void GetParts(StringSegment value, out StringSegment host, out StringSegment port) private static void GetParts(StringSegment value, out StringSegment host, out StringSegment port)
{ {
int index; int index;

View File

@ -23,7 +23,7 @@ namespace Microsoft.AspNetCore.Http.Extensions
/// <param name="path">The portion of the request path that identifies the requested resource.</param> /// <param name="path">The portion of the request path that identifies the requested resource.</param>
/// <param name="query">The query, if any.</param> /// <param name="query">The query, if any.</param>
/// <param name="fragment">The fragment, if any.</param> /// <param name="fragment">The fragment, if any.</param>
/// <returns></returns> /// <returns>The combined URI components, properly encoded for use in HTTP headers.</returns>
public static string BuildRelative( public static string BuildRelative(
PathString pathBase = new PathString(), PathString pathBase = new PathString(),
PathString path = new PathString(), PathString path = new PathString(),
@ -44,7 +44,7 @@ namespace Microsoft.AspNetCore.Http.Extensions
/// <param name="path">The portion of the request path that identifies the requested resource.</param> /// <param name="path">The portion of the request path that identifies the requested resource.</param>
/// <param name="query">The query, if any.</param> /// <param name="query">The query, if any.</param>
/// <param name="fragment">The fragment, if any.</param> /// <param name="fragment">The fragment, if any.</param>
/// <returns></returns> /// <returns>The combined URI components, properly encoded for use in HTTP headers.</returns>
public static string BuildAbsolute( public static string BuildAbsolute(
string scheme, string scheme,
HostString host, HostString host,
@ -90,9 +90,9 @@ namespace Microsoft.AspNetCore.Http.Extensions
public static void FromAbsolute( public static void FromAbsolute(
string uri, string uri,
out string scheme, out string scheme,
out HostString host, out HostString host,
out PathString path, out PathString path,
out QueryString query, out QueryString query,
out FragmentString fragment) out FragmentString fragment)
{ {
if (uri == null) if (uri == null)
@ -134,7 +134,7 @@ namespace Microsoft.AspNetCore.Http.Extensions
path = PathString.FromUriComponent(uri.Substring(searchIndex, limit - searchIndex)); path = PathString.FromUriComponent(uri.Substring(searchIndex, limit - searchIndex));
limit = searchIndex; limit = searchIndex;
} }
host = HostString.FromUriComponent(uri.Substring(startIndex, limit - startIndex)); host = HostString.FromUriComponent(uri.Substring(startIndex, limit - startIndex));
} }
@ -143,7 +143,7 @@ namespace Microsoft.AspNetCore.Http.Extensions
/// HTTP headers. Note that a unicode host name will be encoded as punycode. /// HTTP headers. Note that a unicode host name will be encoded as punycode.
/// </summary> /// </summary>
/// <param name="uri">The Uri to encode.</param> /// <param name="uri">The Uri to encode.</param>
/// <returns></returns> /// <returns>The encoded string version of <paramref name="uri"/>.</returns>
public static string Encode(Uri uri) public static string Encode(Uri uri)
{ {
if (uri == null) if (uri == null)
@ -171,16 +171,16 @@ namespace Microsoft.AspNetCore.Http.Extensions
/// and other HTTP operations. /// and other HTTP operations.
/// </summary> /// </summary>
/// <param name="request">The request to assemble the uri pieces from.</param> /// <param name="request">The request to assemble the uri pieces from.</param>
/// <returns></returns> /// <returns>The encoded string version of the URL from <paramref name="request"/>.</returns>
public static string GetEncodedUrl(this HttpRequest request) public static string GetEncodedUrl(this HttpRequest request)
{ {
return BuildAbsolute(request.Scheme, request.Host, request.PathBase, request.Path, request.QueryString); return BuildAbsolute(request.Scheme, request.Host, request.PathBase, request.Path, request.QueryString);
} }
/// <summary> /// <summary>
/// Returns the relative url /// Returns the relative URI.
/// </summary> /// </summary>
/// <param name="request">The request to assemble the uri pieces from.</param> /// <param name="request">The request to assemble the uri pieces from.</param>
/// <returns></returns> /// <returns>The path and query off of <paramref name="request"/>.</returns>
public static string GetEncodedPathAndQuery(this HttpRequest request) public static string GetEncodedPathAndQuery(this HttpRequest request)
{ {
return BuildRelative(request.PathBase, request.Path, request.QueryString); return BuildRelative(request.PathBase, request.Path, request.QueryString);
@ -191,10 +191,11 @@ namespace Microsoft.AspNetCore.Http.Extensions
/// suitable only for display. This format should not be used in HTTP headers or other HTTP operations. /// suitable only for display. This format should not be used in HTTP headers or other HTTP operations.
/// </summary> /// </summary>
/// <param name="request">The request to assemble the uri pieces from.</param> /// <param name="request">The request to assemble the uri pieces from.</param>
/// <returns></returns> /// <returns>The combined components of the request URL in a fully un-escaped form (except for the QueryString)
/// suitable only for display.</returns>
public static string GetDisplayUrl(this HttpRequest request) public static string GetDisplayUrl(this HttpRequest request)
{ {
var scheme = request.Scheme ?? string.Empty; var scheme = request.Scheme ?? string.Empty;
var host = request.Host.Value ?? string.Empty; var host = request.Host.Value ?? string.Empty;
var pathBase = request.PathBase.Value ?? string.Empty; var pathBase = request.PathBase.Value ?? string.Empty;
var path = request.Path.Value ?? string.Empty; var path = request.Path.Value ?? string.Empty;

View File

@ -35,7 +35,7 @@ namespace Microsoft.AspNetCore.Identity
/// <summary> /// <summary>
/// Constructs a new claim with the type and value. /// Constructs a new claim with the type and value.
/// </summary> /// </summary>
/// <returns></returns> /// <returns>The <see cref="Claim"/> that was produced.</returns>
public virtual Claim ToClaim() public virtual Claim ToClaim()
{ {
return new Claim(ClaimType, ClaimValue); return new Claim(ClaimType, ClaimValue);
@ -51,4 +51,4 @@ namespace Microsoft.AspNetCore.Identity
ClaimValue = other?.Value; ClaimValue = other?.Value;
} }
} }
} }

View File

@ -54,7 +54,7 @@ namespace Microsoft.AspNetCore.Authentication.WsFederation
/// <summary> /// <summary>
/// Overridden to handle remote signout requests /// Overridden to handle remote signout requests
/// </summary> /// </summary>
/// <returns></returns> /// <returns><code>true</code> if request processing should stop.</returns>
public override Task<bool> HandleRequestAsync() public override Task<bool> HandleRequestAsync()
{ {
// RemoteSignOutPath and CallbackPath may be the same, fall through if the message doesn't match. // RemoteSignOutPath and CallbackPath may be the same, fall through if the message doesn't match.
@ -149,7 +149,7 @@ namespace Microsoft.AspNetCore.Authentication.WsFederation
&& Request.Body.CanRead) && Request.Body.CanRead)
{ {
var form = await Request.ReadFormAsync(); var form = await Request.ReadFormAsync();
wsFederationMessage = new WsFederationMessage(form.Select(pair => new KeyValuePair<string, string[]>(pair.Key, pair.Value))); wsFederationMessage = new WsFederationMessage(form.Select(pair => new KeyValuePair<string, string[]>(pair.Key, pair.Value)));
} }
@ -163,7 +163,7 @@ namespace Microsoft.AspNetCore.Authentication.WsFederation
return HandleRequestResult.Fail("No message."); return HandleRequestResult.Fail("No message.");
} }
try try
{ {
// Retrieve our cached redirect uri // Retrieve our cached redirect uri
@ -422,4 +422,4 @@ namespace Microsoft.AspNetCore.Authentication.WsFederation
return BuildRedirectUri(uri); return BuildRedirectUri(uri);
} }
} }
} }