Provides consistent context information between the client and server DataPortal objects. More...
Public Types | |
enum | ExecutionLocations { Client , Server } |
Enum representing the locations code can execute. More... | |
enum | PropertyChangedModes { Windows , Xaml } |
Enum representing the way in which CSLA .NET should raise PropertyChanged events. More... | |
enum | LogicalExecutionLocations { Client , Server } |
Enum representing the logical execution location The setting is set to server when server is execting a CRUD opertion, otherwise the setting is always client More... | |
Public Member Functions | |
ApplicationContext (ApplicationContextAccessor applicationContextAccessor) | |
Creates a new instance of the type More... | |
void | Clear () |
Clears all context collections. More... | |
T | CreateInstanceDI< T > (params object[] parameters) |
Creates an object using 'Activator.CreateInstance' using service provider (if one is available) to populate any parameters in CTOR that are not manually passed in. More... | |
T | GetRequiredService< T > () |
Attempts to get service via DI using ServiceProviderServiceExtensions.GetRequiredService. More... | |
object | GetRequiredService (Type serviceType) |
Attempts to get service via DI using ServiceProviderServiceExtensions.GetRequiredService. More... | |
object | CreateInstanceDI (Type objectType, params object[] parameters) |
Creates an object using 'Activator.CreateInstance' using service provider (if one is available) to populate any parameters in CTOR that are not manually passed in. More... | |
T | CreateInstance< T > (params object[] parameters) |
Creates an object using Activator. More... | |
object | CreateInstance (Type objectType, params object[] parameters) |
Creates an object using Activator. More... | |
Static Public Attributes | |
const string | DefaultRuleSet = "default" |
The default RuleSet name More... | |
Properties | |
IContextManager | ContextManager [get] |
Gets the context manager responsible for storing user and context information for the application. More... | |
ClaimsPrincipal | Principal [getset] |
Get or set the current ClaimsPrincipal object representing the user's identity. More... | |
IPrincipal | User [getset] |
Get or set the current IPrincipal object representing the user's identity. More... | |
ContextDictionary | LocalContext [get] |
Returns the application-specific context data that is local to the current AppDomain. More... | |
ContextDictionary | ClientContext [get] |
Returns the application-specific context data provided by the client. More... | |
bool | IsOffline [getset] |
Gets or sets a value indicating whether the app should be considered "offline". More... | |
static bool | UseReflectionFallback = false [getset] |
Gets or sets a value indicating whether CSLA should fallback to using reflection instead of System.Linq.Expressions (true, default). More... | |
static string | VersionRoutingTag [getset] |
Gets a value representing the application version for use in server-side data portal routing. More... | |
static string | AuthenticationType = "Csla" [getset] |
Gets the authentication type being used by the CSLA .NET framework. More... | |
static bool | AutoCloneOnUpdate = true [getset] |
Gets a value indicating whether objects should be automatically cloned by the data portal Update() method when using a local data portal configuration. More... | |
static bool | DataPortalReturnObjectOnException [getset] |
Gets a value indicating whether the server-side business object should be returned to the client as part of the DataPortalException (default is false). More... | |
static Type | SerializationFormatter = typeof(Serialization.Mobile.MobileFormatter) [getset] |
Gets the serialization formatter type used by CSLA .NET for all explicit object serialization (such as cloning, n-level undo, etc). More... | |
static PropertyChangedModes | PropertyChangedMode [getset] |
Gets or sets a value specifying how CSLA .NET should raise PropertyChanged events. More... | |
ExecutionLocations | ExecutionLocation [get] |
Returns a value indicating whether the application code is currently executing on the client or server. More... | |
string? | RuleSet [getset] |
Gets or sets the RuleSet name to use for static HasPermission calls. More... | |
static TransactionIsolationLevel | DefaultTransactionIsolationLevel = TransactionIsolationLevel.Unspecified [getset] |
Gets or sets the default transaction isolation level. More... | |
static int | DefaultTransactionTimeoutInSeconds = 30 [getset] |
Gets or sets the default transaction timeout in seconds. More... | |
static System.Transactions.TransactionScopeAsyncFlowOption | DefaultTransactionAsyncFlowOption = System.Transactions.TransactionScopeAsyncFlowOption.Suppress [getset] |
Gets or sets the default transaction async flow option used to create new TransactionScope objects. More... | |
LogicalExecutionLocations | LogicalExecutionLocation [get] |
Return Logical Execution Location - Client or Server This is applicable to Local mode as well More... | |
bool | IsAStatefulContextManager [get] |
Gets a value indicating whether the current context manager is used in a stateful context (e.g. More... | |
Provides consistent context information between the client and server DataPortal objects.
Definition at line 21 of file ApplicationContext.cs.
Enum representing the locations code can execute.
Enumerator | |
---|---|
Client | The code is executing on the client. |
Server | The code is executing on the application server. |
Definition at line 201 of file ApplicationContext.cs.
Enum representing the logical execution location The setting is set to server when server is execting a CRUD opertion, otherwise the setting is always client
Enumerator | |
---|---|
Client | The code is executing on the client. |
Server | The code is executing on the server. This includes Local mode execution |
Definition at line 318 of file ApplicationContext.cs.
Enum representing the way in which CSLA .NET should raise PropertyChanged events.
Enumerator | |
---|---|
Windows | Raise PropertyChanged events as required by Windows Forms data binding. |
Xaml | Raise PropertyChanged events as required by XAML data binding in WPF. |
Definition at line 230 of file ApplicationContext.cs.
Csla.ApplicationContext.ApplicationContext | ( | ApplicationContextAccessor | applicationContextAccessor | ) |
Creates a new instance of the type
applicationContextAccessor |
Definition at line 27 of file ApplicationContext.cs.
void Csla.ApplicationContext.Clear | ( | ) |
Clears all context collections.
Definition at line 142 of file ApplicationContext.cs.
object Csla.ApplicationContext.CreateInstance | ( | Type | objectType, |
params object[] | parameters | ||
) |
Creates an object using Activator.
objectType | Type of object to create |
parameters | Parameters for constructor |
Definition at line 464 of file ApplicationContext.cs.
T Csla.ApplicationContext.CreateInstance< T > | ( | params object[] | parameters | ) |
Creates an object using Activator.
T | Type of object to create. |
parameters | Parameters for constructor |
Definition at line 453 of file ApplicationContext.cs.
object Csla.ApplicationContext.CreateInstanceDI | ( | Type | objectType, |
params object[] | parameters | ||
) |
Creates an object using 'Activator.CreateInstance' using service provider (if one is available) to populate any parameters in CTOR that are not manually passed in.
objectType | Type of object to create |
parameters | Manually passed in parameters for constructor |
Definition at line 419 of file ApplicationContext.cs.
T Csla.ApplicationContext.CreateInstanceDI< T > | ( | params object[] | parameters | ) |
Creates an object using 'Activator.CreateInstance' using service provider (if one is available) to populate any parameters in CTOR that are not manually passed in.
T | Type of object to create. |
parameters | Parameters for constructor |
Definition at line 377 of file ApplicationContext.cs.
object Csla.ApplicationContext.GetRequiredService | ( | Type | serviceType | ) |
Attempts to get service via DI using ServiceProviderServiceExtensions.GetRequiredService.
Throws exception if service not properly registered with DI.
serviceType | Type of service/object to create. |
Definition at line 403 of file ApplicationContext.cs.
T Csla.ApplicationContext.GetRequiredService< T > | ( | ) |
Attempts to get service via DI using ServiceProviderServiceExtensions.GetRequiredService.
Throws exception if service not properly registered with DI.
T | Type of service/object to create. |
Definition at line 388 of file ApplicationContext.cs.
|
static |
The default RuleSet name
Definition at line 268 of file ApplicationContext.cs.
|
staticgetset |
Gets the authentication type being used by the CSLA .NET framework.
Definition at line 181 of file ApplicationContext.cs.
|
staticgetset |
Gets a value indicating whether objects should be automatically cloned by the data portal Update() method when using a local data portal configuration.
Definition at line 188 of file ApplicationContext.cs.
|
get |
Returns the application-specific context data provided by the client.
The return value is a HybridDictionary. If one does not already exist, and empty one is created and returned.
Note that data in this context is transferred from the client to the server. No data is transferred from the server to the client.
This property is thread safe in a Windows client setting and on an application server. It is not guaranteed to be thread safe within the context of an ASP.NET client setting (i.e. in your ASP.NET UI).
Definition at line 116 of file ApplicationContext.cs.
|
get |
Gets the context manager responsible for storing user and context information for the application.
Definition at line 40 of file ApplicationContext.cs.
|
staticgetset |
Gets a value indicating whether the server-side business object should be returned to the client as part of the DataPortalException (default is false).
Definition at line 196 of file ApplicationContext.cs.
|
staticgetset |
Gets or sets the default transaction async flow option used to create new TransactionScope objects.
Definition at line 307 of file ApplicationContext.cs.
|
staticgetset |
Gets or sets the default transaction isolation level.
The default transaction isolation level.
Definition at line 293 of file ApplicationContext.cs.
|
staticgetset |
Gets or sets the default transaction timeout in seconds.
The default transaction timeout in seconds.
Definition at line 301 of file ApplicationContext.cs.
|
get |
Returns a value indicating whether the application code is currently executing on the client or server.
Definition at line 255 of file ApplicationContext.cs.
|
get |
Gets a value indicating whether the current context manager is used in a stateful context (e.g.
WPF, Blazor, etc.)
Definition at line 362 of file ApplicationContext.cs.
|
getset |
Gets or sets a value indicating whether the app should be considered "offline".
If this value is true then the client-side data portal will direct all calls to the local data portal. No calls will flow to remote data portal endpoints.
Definition at line 160 of file ApplicationContext.cs.
|
get |
Returns the application-specific context data that is local to the current AppDomain.
The return value is a HybridDictionary. If one does not already exist, and empty one is created and returned.
Note that data in this context is NOT transferred to and from the client and server.
Definition at line 81 of file ApplicationContext.cs.
|
get |
Return Logical Execution Location - Client or Server This is applicable to Local mode as well
Definition at line 335 of file ApplicationContext.cs.
|
getset |
Get or set the current ClaimsPrincipal object representing the user's identity.
Definition at line 46 of file ApplicationContext.cs.
|
staticgetset |
Gets or sets a value specifying how CSLA .NET should raise PropertyChanged events.
Definition at line 224 of file ApplicationContext.cs.
|
getset |
Gets or sets the RuleSet name to use for static HasPermission calls.
The rule set.
Definition at line 274 of file ApplicationContext.cs.
|
staticgetset |
Gets the serialization formatter type used by CSLA .NET for all explicit object serialization (such as cloning, n-level undo, etc).
Definition at line 218 of file ApplicationContext.cs.
|
getset |
Get or set the current IPrincipal object representing the user's identity.
This is discussed in Chapter 5. When running under IIS the HttpContext.Current.User value is used, otherwise the current Thread.CurrentPrincipal value is used.
Definition at line 62 of file ApplicationContext.cs.
|
staticgetset |
Gets or sets a value indicating whether CSLA should fallback to using reflection instead of System.Linq.Expressions (true, default).
Definition at line 167 of file ApplicationContext.cs.
|
staticgetset |
Gets a value representing the application version for use in server-side data portal routing.
Definition at line 173 of file ApplicationContext.cs.