Show / Hide Table of Contents

Class ExecutionContext

Provides access to execution context - that groups Application, Request, Response and Session objects. All objects may be either application-global or thread-level. Effectively ExecutionContext.Application is the central DI/servi e locator facility per process. The async code should flow the context by passing it to functors.

Inheritance
System.Object
ExecutionContext
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: NFX.ApplicationModel
Assembly: NFX.dll
Syntax
public static class ExecutionContext
Remarks

This pattern is used on purpose based on careful evaluation of various DI frameworks use-cases in various projects, both server and client-side. The central service/locator hub per process as faciliatetd by the IApplication is the most intuitive ans simple dependency resolution facility for 90+% of various business applications.

Properties

Application

Returns global application context

Declaration
public static IApplication Application { get; }
Property Value
Type Description
IApplication

HasThreadContextSession

Returns true when thread-level session object is available and not a NOPSession instance

Declaration
public static bool HasThreadContextSession { get; }
Property Value
Type Description
System.Boolean

Request

Returns Request object for current thread, or if it is null, app-global-level object is returned

Declaration
public static object Request { get; }
Property Value
Type Description
System.Object

Response

Returns Response object for current thread, or if it is null, app-global-level object is returned

Declaration
public static object Response { get; }
Property Value
Type Description
System.Object

Session

Returns Session object for current thread, or if it is null, app-global-level object is returned

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

__SetApplicationLevelContext(Object, Object, ISession)

Internal framework-only method to bind application-level context

Declaration
public static void __SetApplicationLevelContext(object request, object response, ISession session)
Parameters
Type Name Description
System.Object request
System.Object response
ISession session

__SetThreadLevelContext(Object, Object, ISession)

Internal framework-only method to bind thread-level context

Declaration
public static void __SetThreadLevelContext(object request, object response, ISession session)
Parameters
Type Name Description
System.Object request
System.Object response
ISession session

__SetThreadLevelSessionContext(ISession)

Internal framework-only method to bind thread-level 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
Back to top Copyright © 2006-2018 Agnicore Inc
Generated by DocFX