2 implementations of IMiddleware
Microsoft.AspNetCore.Http.Abstractions.Tests (1)
UseMiddlewareTest.cs (1)
282public class Middleware : IMiddleware
Microsoft.AspNetCore.Tests (1)
WebApplicationTests.cs (1)
2841private class MiddlewareWithInterface : IMiddleware
20 references to IMiddleware
Microsoft.AspNetCore.Http (3)
MiddlewareFactory.cs (3)
28public IMiddleware? Create(Type middlewareType) 30return _serviceProvider.GetRequiredService(middlewareType) as IMiddleware; 34public void Release(IMiddleware middleware)
Microsoft.AspNetCore.Http.Abstractions (9)
Extensions\UseMiddlewareExtensions.cs (3)
54if (typeof(IMiddleware).IsAssignableFrom(middleware)) 60throw new NotSupportedException(Resources.FormatException_UseMiddlewareExplicitArgumentsNotSupported(typeof(IMiddleware))); 179var middleware = middlewareFactory.Create(_middlewareType);
IMiddlewareFactory.cs (6)
14/// <param name="middlewareType">The concrete <see cref="Type"/> of the <see cref="IMiddleware"/>.</param> 15/// <returns>The <see cref="IMiddleware"/> instance.</returns> 16IMiddleware? Create(Type middlewareType); 19/// Releases a <see cref="IMiddleware"/> instance at the end of each request. 21/// <param name="middleware">The <see cref="IMiddleware"/> instance to release.</param> 22void Release(IMiddleware middleware);
Microsoft.AspNetCore.Http.Abstractions.Tests (8)
UseMiddlewareTest.cs (8)
217Assert.Equal(Resources.FormatException_UseMiddlewareExplicitArgumentsNotSupported(typeof(IMiddleware)), exception.Message); 294public IMiddleware? Created { get; private set; } 295public IMiddleware? Released { get; private set; } 297public IMiddleware? Create(Type middlewareType) 299Created = Activator.CreateInstance(middlewareType) as IMiddleware; 303public void Release(IMiddleware middleware) 311public IMiddleware? Create(Type middlewareType) => null; 313public void Release(IMiddleware middleware) { }