我有一个异步方法,它使用 HttpContext.Current,它由另一个在后台运行的代码使用,例如
var result = Task.Run(async () => await SomeMethod()).Result;
HttpContext.Current 始终为 null。有没有办法将 HttpContext 传递给后台任务?
c# asp.net httpcontext task-parallel-library async-await
asp.net ×1
async-await ×1
c# ×1
httpcontext ×1
task-parallel-library ×1