25 private const string _localContextName =
"Csla.LocalContext";
26 private const string _clientContextName =
"Csla.ClientContext";
35 get {
return HttpContext.Current !=
null; }
47 public System.Security.Principal.IPrincipal
GetUser()
49 var result = HttpContext.Current.User;
52 result =
new System.Security.Claims.ClaimsPrincipal();
62 public void SetUser(System.Security.Principal.IPrincipal principal)
64 HttpContext.Current.User = principal;
81 HttpContext.Current.Items[_localContextName] = localContext;
100 HttpContext.Current.Items[_clientContextName] = clientContext;
103 private const string _applicationContextName =
"Csla.ApplicationContext";
116 HttpContext.Current.Items[_applicationContextName] = value;
Provides consistent context information between the client and server DataPortal objects.
ExecutionLocations
Enum representing the locations code can execute.
Dictionary type that is serializable with the SerializationFormatterFactory.GetFormatter().
Application context manager that uses HttpContext to store context values.
void SetUser(System.Security.Principal.IPrincipal principal)
Sets the current principal.
System.Security.Principal.IPrincipal GetUser()
Gets the current principal.
void SetClientContext(ContextDictionary clientContext, ApplicationContext.ExecutionLocations executionLocation)
Sets the client context.
bool IsValid
Gets a value indicating whether this context manager is valid for use in the current environment.
bool IsStatefulContext
Gets a value indicating whether the current runtime is stateful (e.g.
void SetLocalContext(ContextDictionary localContext)
Sets the local context.
ApplicationContextManager()
Creates an instance of the type.
ContextDictionary GetLocalContext()
Gets the local context.
ContextDictionary GetClientContext(ApplicationContext.ExecutionLocations executionLocation)
Gets the client context.
Defines the interface for an application context manager type.