Class SettingPresetService
- Namespace
- Dynamicweb.SettingPresets
- Assembly
- Dynamicweb.Core.dll
The SettingPresetService class providing methods for querying and saving the SettingPreset Aggregate to and from persistence.
public class SettingPresetService : ICacheStorage<int, SettingPreset>, ICacheStorage<int>, ICacheStorage
- Inheritance
-
SettingPresetService
- Implements
- Inherited Members
Methods
ClearCache()
Resets all keys to the default value for objects stored in the object cache
public void ClearCache()
ClearCache(IEnumerable<int>)
Resets the specified keys to the default value for objects stored in the object cache
public void ClearCache(IEnumerable<int> keys)
Parameters
keysIEnumerable<int>Keys to reset
ClearCache(int)
Resets the specified key to the default value for objects stored in the object cache
public void ClearCache(int key)
Parameters
keyintKey to reset
Delete(List<int>)
Deletes the SettingPreset, its values and relations.
public void Delete(List<int> SettingPresetIds)
Parameters
Delete(int)
Deletes the SettingPreset, its values and relations.
public void Delete(int SettingPresetId)
Parameters
SettingPresetIdintThe SettingPreset ID.
GetAll()
Gets all Setting presets
public IEnumerable<SettingPreset> GetAll()
Returns
- IEnumerable<SettingPreset>
The collection of the SettingPreset
GetByGroupIds(IEnumerable<int>)
Get all the presets which is assigned to eiher of the given user groups
public IEnumerable<SettingPreset> GetByGroupIds(IEnumerable<int> groupIds)
Parameters
groupIdsIEnumerable<int>A list of user group ids
Returns
- IEnumerable<SettingPreset>
The collection of the SettingPreset.
GetById(int)
Gets the Setting preset matching the given id
public SettingPreset? GetById(int id)
Parameters
idintThe id for the setting preset to find
Returns
GetByTarget(string)
Gets current user Setting presets for specific Target.
public IEnumerable<SettingPreset> GetByTarget(string target)
Parameters
targetstringThe preset target.
Returns
- IEnumerable<SettingPreset>
The collection of the SettingPreset.
GetByTarget(string, int)
Gets the user Setting presets for specific Target.
public IEnumerable<SettingPreset> GetByTarget(string target, int userId)
Parameters
Returns
- IEnumerable<SettingPreset>
The collection of the SettingPreset.
GetByUserId(int)
Get all the presets which is assigned directly to the given userId
public IEnumerable<SettingPreset> GetByUserId(int userId)
Parameters
userIdintThe user ID.
Returns
- IEnumerable<SettingPreset>
The collection of the SettingPreset.
GetCache(IEnumerable<int>)
public IEnumerable<SettingPreset> GetCache(IEnumerable<int> keys)
Parameters
keysIEnumerable<int>
Returns
GetCache(int)
public SettingPreset? GetCache(int key)
Parameters
keyint
Returns
GetValues(int)
Gets the Setting preset values.
public Dictionary<string, SettingPresetValue>? GetValues(int presetId)
Parameters
presetIdintThe preset ID.
Returns
- Dictionary<string, SettingPresetValue>
The dictionary of the SettingPresetValue with Key as key.
Save(SettingPreset)
Saves the SettingPreset.
public void Save(SettingPreset settingPreset)
Parameters
settingPresetSettingPresetThe SettingPreset.
SaveValues(IEnumerable<SettingPresetValue>)
Saves the Setting preset values.
public void SaveValues(IEnumerable<SettingPresetValue> presetValues)
Parameters
presetValuesIEnumerable<SettingPresetValue>The Setting preset values.