refactor(middleware): Entferne WebApiMiddleware
This commit is contained in:
parent
a55b4c5f63
commit
bb61c6dca0
@ -1,25 +0,0 @@
|
|||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
using System.IO;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace HRD.WebApi.DAL.Middleware
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the current API resource name from HTTP context
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="httpContext">The HTTP context</param>
|
|
||||||
/// <returns>The current resource name if available, otherwise an empty string</returns>
|
|
||||||
|
|
||||||
public class WebApiMiddleware
|
|
||||||
{
|
|
||||||
private readonly RequestDelegate _next;
|
|
||||||
private readonly ILogger<WebApiMiddleware> _logger;
|
|
||||||
|
|
||||||
public WebApiMiddleware(RequestDelegate next, ILogger<WebApiMiddleware> logger)
|
|
||||||
{
|
|
||||||
_next = next;
|
|
||||||
_logger = logger;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -6,11 +6,6 @@ namespace HRD.WebApi.DAL.Middleware
|
|||||||
{
|
{
|
||||||
public static class WebApiMiddlewareExtensions
|
public static class WebApiMiddlewareExtensions
|
||||||
{
|
{
|
||||||
public static IApplicationBuilder UseDALMiddleware(this IApplicationBuilder builder)
|
|
||||||
{
|
|
||||||
return builder.UseMiddleware<WebApiMiddleware>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void ConfigureDAL(this IServiceCollection services, WebApiMiddlewareOptions options)
|
public static void ConfigureDAL(this IServiceCollection services, WebApiMiddlewareOptions options)
|
||||||
{
|
{
|
||||||
if (options == null)
|
if (options == null)
|
||||||
|
|||||||
@ -144,7 +144,6 @@ try
|
|||||||
app.UseDefaultFiles();
|
app.UseDefaultFiles();
|
||||||
app.UseStaticFiles();
|
app.UseStaticFiles();
|
||||||
app.UseOpenApi();
|
app.UseOpenApi();
|
||||||
app.UseDALMiddleware();
|
|
||||||
app.UseJwtMiddleware();
|
app.UseJwtMiddleware();
|
||||||
app.UseSwaggerUi(cfg => cfg.DocExpansion = "none");
|
app.UseSwaggerUi(cfg => cfg.DocExpansion = "none");
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user