Class ExecutionContext
Infrastructure class that should never be used in business applications Provides access to execution context - that groups Application and Session objects. All objects may be either application-global or (logical)thread-level. Effectively ExecutionContext.Application is the central chassis per process. The async code flows Session context automatically via Thread.Principal, however custom contexts should flow via passing it to functors.
Inheritance
Inherited Members
Namespace: Azos.Apps
Assembly: Azos.dll
Syntax
public static class ExecutionContext
Properties
Application
Returns global application context
Declaration
public static IApplication Application { get; }
Property Value
Type | Description |
---|---|
IApplication |
HasThreadContextSession
Returns true when thread-level or async call context session object is available and not a NOPSession instance Note: Thread.CurrentPrincipal auto-flows by async/await and other TAP
Declaration
public static bool HasThreadContextSession { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Session
Returns Session object for current thread or async flow context, or if it is null NOPSession object is returned. Note: Thread.CurrentPrincipal auto-flows by async/await and other TAP
Declaration
public static ISession Session { get; }
Property Value
Type | Description |
---|---|
ISession |
Methods
__BindApplication(IApplication)
Framework internal app bootstrapping method. Sets root application context
Declaration
public static void __BindApplication(IApplication application)
Parameters
Type | Name | Description |
---|---|---|
IApplication | application |
__SetThreadLevelSessionContext(ISession)
Internal framework-only method to bind thread-level/async flow context
Declaration
public static void __SetThreadLevelSessionContext(ISession session)
Parameters
Type | Name | Description |
---|---|---|
ISession | session |
__UnbindApplication(IApplication)
Framework internal app bootstrapping method. Resets root application context
Declaration
public static void __UnbindApplication(IApplication application)
Parameters
Type | Name | Description |
---|---|---|
IApplication | application |