What “Current” properties flow with ExecutionContext

前端 未结 1 1527
生来不讨喜
生来不讨喜 2020-12-06 03:35

This is a two part question:

  1. Can someone provide a list of the ASP.NET/.NET properties that are typically thread local that flow with ExecutionContext?

相关标签:
1条回答
  • 2020-12-06 03:50

    The best resource for this is ExecutionContext vs. SynchronizationContext by Stephen Toub. There is no list of properties like what you're looking for.

    ASP.NET actually uses SynchronizationContext to flow HttpContext.Current, and treats Thread.CurrentPrincipal rather oddly.

    You can add your own context using LogicalSetData/LogicalGetData. However, you should only store immutable data. I document this on my blog.

    0 讨论(0)
提交回复
热议问题