Class UnityPersistenceBackendActivator
Constructs the PersistenceInstaller configured on a UnityPersistenceBackendDefinition via reflection. Never throws: any resolution or construction failure is logged and reported as a failed TryCreate(UnityPersistenceBackendDefinition, string, string, ILogService, out PersistenceInstaller) call, so callers can fall back to the built-in file backend.
Inherited Members
Namespace: Serenity.Global.Installation.Settings
Assembly: Serenity.UnityGlobal.Installation.dll
Syntax
public static class UnityPersistenceBackendActivator
Methods
TryCreate(UnityPersistenceBackendDefinition, string, string, ILogService, out PersistenceInstaller)
Attempts to construct the installer described by definition.
Declaration
public static bool TryCreate(UnityPersistenceBackendDefinition definition, string companyName, string productName, ILogService logService, out PersistenceInstaller installer)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityPersistenceBackendDefinition | definition | The backend definition to activate. |
| string | companyName | The running app's company name, used when PassCompanyAndProduct is set. |
| string | productName | The running app's product name, used when PassCompanyAndProduct is set. |
| ILogService | logService | Log service used to report resolution or construction failures. |
| PersistenceInstaller | installer | The constructed installer, or null on failure. |
Returns
| Type | Description |
|---|---|
| bool | True if the installer was constructed successfully; otherwise false. |
UnwrapInvocationException(Exception)
Returns the real failure behind a reflection call: the inner exception when
exception is a TargetInvocationException wrapper, the exception
itself otherwise. Public because UnitySerenityInstaller.InstallPersistence applies the same
unwrap rule when a custom backend's Install throws.
Declaration
public static Exception UnwrapInvocationException(Exception exception)
Parameters
| Type | Name | Description |
|---|---|---|
| Exception | exception | The caught exception, possibly a reflection wrapper. |
Returns
| Type | Description |
|---|---|
| Exception | The root-cause exception to log. |