blob: 0b7c7b1710199d706b2cb8f16f3d88343c594c55 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
namespace Microsoft.AspNetCore.Http;
/// <summary>
/// Provides methods to create middleware.
/// </summary>
public interface IMiddlewareFactory
{
/// <summary>
/// Creates a middleware instance for each request.
/// </summary>
/// <param name="middlewareType">The concrete <see cref="Type"/> of the <see cref="IMiddleware"/>.</param>
/// <returns>The <see cref="IMiddleware"/> instance.</returns>
IMiddleware? Create(Type middlewareType);
/// <summary>
/// Releases a <see cref="IMiddleware"/> instance at the end of each request.
/// </summary>
/// <param name="middleware">The <see cref="IMiddleware"/> instance to release.</param>
void Release(IMiddleware middleware);
}
|