CSLA.NET 6.0.0
CSLA .NET is a software development framework that helps you build a reusable, maintainable object-oriented business layer for your app.
Csla.Core.ApplicationContextManagerAsyncLocal Class Reference

Application context manager using AsyncLocal for user and context dictionaries. More...

Inheritance diagram for Csla.Core.ApplicationContextManagerAsyncLocal:
Csla.Core.IContextManagerLocal Csla.Core.IContextManager Csla.TestHelpers.ApplicationContextManagerUnitTests

Public Member Functions

virtual IPrincipal GetUser ()
 Gets the current user principal. More...
 
virtual void SetUser (IPrincipal principal)
 Sets the current user principal. More...
 
ContextDictionary GetLocalContext ()
 Gets the local context dictionary. More...
 
void SetLocalContext (ContextDictionary localContext)
 Sets the local context dictionary. More...
 
ContextDictionary GetClientContext (ApplicationContext.ExecutionLocations executionLocation)
 Gets the client context dictionary. More...
 
void SetClientContext (ContextDictionary clientContext, ApplicationContext.ExecutionLocations executionLocation)
 Sets the client context dictionary. More...
 

Protected Member Functions

virtual void OnApplicationContextSet ()
 Method called when the ApplicationContext property has been set to a new value. More...
 

Properties

bool IsStatefulContext [get]
 Gets a value indicating whether the context manager is stateful. More...
 
bool IsValid [get]
 Returns a value indicating whether the context is valid. More...
 
ApplicationContext ApplicationContext [getset]
 Gets or sets a reference to the current ApplicationContext. More...
 
- Properties inherited from Csla.Core.IContextManager
bool IsStatefulContext [get]
 Gets a value indicating whether this
context manager is used in a stateful context (e.g. More...
 
bool IsValid [get]
 Gets a value indicating whether this context manager is valid for use in the current environment. More...
 
ApplicationContext ApplicationContext [getset]
 Gets or sets a reference to the current ApplicationContext. More...
 

Detailed Description

Application context manager using AsyncLocal for user and context dictionaries.

Definition at line 17 of file ApplicationContextManagerAsyncLocal.cs.

Member Function Documentation

◆ GetClientContext()

ContextDictionary Csla.Core.ApplicationContextManagerAsyncLocal.GetClientContext ( ApplicationContext.ExecutionLocations  executionLocation)

Gets the client context dictionary.

Parameters
executionLocation

Implements Csla.Core.IContextManager.

Definition at line 82 of file ApplicationContextManagerAsyncLocal.cs.

◆ GetLocalContext()

ContextDictionary Csla.Core.ApplicationContextManagerAsyncLocal.GetLocalContext ( )

Gets the local context dictionary.

Implements Csla.Core.IContextManager.

Definition at line 64 of file ApplicationContextManagerAsyncLocal.cs.

◆ GetUser()

virtual IPrincipal Csla.Core.ApplicationContextManagerAsyncLocal.GetUser ( )
virtual

Gets the current user principal.

Returns
The current user principal

Implements Csla.Core.IContextManager.

Definition at line 41 of file ApplicationContextManagerAsyncLocal.cs.

◆ OnApplicationContextSet()

virtual void Csla.Core.ApplicationContextManagerAsyncLocal.OnApplicationContextSet ( )
protectedvirtual

Method called when the ApplicationContext property has been set to a new value.

Definition at line 119 of file ApplicationContextManagerAsyncLocal.cs.

◆ SetClientContext()

void Csla.Core.ApplicationContextManagerAsyncLocal.SetClientContext ( ContextDictionary  clientContext,
ApplicationContext.ExecutionLocations  executionLocation 
)

Sets the client context dictionary.

Parameters
clientContextContext dictionary
executionLocation

Implements Csla.Core.IContextManager.

Definition at line 92 of file ApplicationContextManagerAsyncLocal.cs.

◆ SetLocalContext()

void Csla.Core.ApplicationContextManagerAsyncLocal.SetLocalContext ( ContextDictionary  localContext)

Sets the local context dictionary.

Parameters
localContextContext dictionary

Implements Csla.Core.IContextManager.

Definition at line 73 of file ApplicationContextManagerAsyncLocal.cs.

◆ SetUser()

virtual void Csla.Core.ApplicationContextManagerAsyncLocal.SetUser ( IPrincipal  principal)
virtual

Sets the current user principal.

Parameters
principalUser principal value

Implements Csla.Core.IContextManager.

Definition at line 56 of file ApplicationContextManagerAsyncLocal.cs.

Property Documentation

◆ ApplicationContext

ApplicationContext Csla.Core.ApplicationContextManagerAsyncLocal.ApplicationContext
getset

Gets or sets a reference to the current ApplicationContext.

Definition at line 102 of file ApplicationContextManagerAsyncLocal.cs.

◆ IsStatefulContext

bool Csla.Core.ApplicationContextManagerAsyncLocal.IsStatefulContext
get

Gets a value indicating whether the context manager is stateful.

Definition at line 27 of file ApplicationContextManagerAsyncLocal.cs.

◆ IsValid

bool Csla.Core.ApplicationContextManagerAsyncLocal.IsValid
get

Returns a value indicating whether the context is valid.

Definition at line 32 of file ApplicationContextManagerAsyncLocal.cs.