Class ClientCacheManager
Inherited Members
Namespace: LemonEdge.Client.Core
Assembly: LemonEdge.Client.Core.dll
Syntax
public class ClientCacheManager : AddinEventHandler, IHaveAddInListeners, ICacheManager
Constructors
ClientCacheManager(IAddInLoaderHelper, IDomainContextEventHandler, IEntityDescriptorFactory, ILogger<ClientCacheManager>)
Declaration
public ClientCacheManager(IAddInLoaderHelper loader, IDomainContextEventHandler eventHandler, IEntityDescriptorFactory entityDescriptorFactory, ILogger<ClientCacheManager> logger)
Parameters
Type | Name | Description |
---|---|---|
IAddInLoaderHelper | loader | |
IDomainContextEventHandler | eventHandler | |
IEntityDescriptorFactory | entityDescriptorFactory | |
ILogger<ClientCacheManager> | logger |
Methods
CreateCache(IEntityUpdater)
Creates a cache
Declaration
public IReadOnlyCache CreateCache(IEntityUpdater context)
Parameters
Type | Name | Description |
---|---|---|
IEntityUpdater | context |
Returns
Type | Description |
---|---|
IReadOnlyCache |
ReLoadCache(Action<string>, Action<string>, Func<Exception, Task>, bool, bool)
Reloads the current global cache for the application
Declaration
public Task<LicenseResult> ReLoadCache(Action<string> loadingUpdate, Action<string> licenseUpdate, Func<Exception, Task> processException, bool forceRefresh = false, bool keepCurrentIfValidCache = true)
Parameters
Type | Name | Description |
---|---|---|
Action<string> | loadingUpdate | An action to notify a listener of the progress reloading the cache |
Action<string> | licenseUpdate | An action to notify a listener of the license status once loaded |
Func<Exception, Task> | processException | |
bool | forceRefresh | If false the cache will be loaded from a local copy, unless one does not exist or it is out of date. Otherwise it will always be loaded from the system again. |
bool | keepCurrentIfValidCache | Indicates if the cache is current, then not to bother reloading it at all either locally or from the service |
Returns
Type | Description |
---|---|
Task<LicenseResult> | A task indicating the completion of the operation |