一、Asp.Net Core 6获取IHttpContextAccessor方法
var app = builder.Build(); var httpContextAccessor = app.ApplicationServices.GetRequiredService<IHttpContextAccessor>();
更多:
Asp.Net Core获取请求上下文HttpContext
一、Asp.Net Core 6获取IHttpContextAccessor方法
var app = builder.Build(); var httpContextAccessor = app.ApplicationServices.GetRequiredService<IHttpContextAccessor>();
更多:
Asp.Net Core获取请求上下文HttpContext