This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) .NET Foundation. All rights reserved. | |
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | |
/// <summary> | |
/// Adds a middleware type to the application's request pipeline. | |
/// </summary> | |
/// <typeparam name="TMiddleware">The middleware type.</typeparam> | |
/// <param name="app">The <see cref="IApplicationBuilder"/> instance.</param> | |
/// <param name="args">The arguments to pass to the middleware type instance's constructor.</param> | |
/// <returns>The <see cref="IApplicationBuilder"/> instance.</returns> | |
public static IApplicationBuilder UseMiddleware<[DynamicallyAccessedMembers(MiddlewareAccessibility)]TMiddleware>(this IApplicationBuilder app, params object?[] args) | |
{ | |
return app.UseMiddleware(typeof(TMiddleware), args); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment