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
keys
IEnumerable<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
key
intKey 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
SettingPresetId
intThe 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
groupIds
IEnumerable<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
id
intThe 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
target
stringThe 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
userId
intThe user ID.
Returns
- IEnumerable<SettingPreset>
The collection of the SettingPreset.
GetCache(IEnumerable<int>)
public IEnumerable<SettingPreset> GetCache(IEnumerable<int> keys)
Parameters
keys
IEnumerable<int>
Returns
GetCache(int)
public SettingPreset? GetCache(int key)
Parameters
key
int
Returns
GetValues(int)
Gets the Setting preset values.
public Dictionary<string, SettingPresetValue>? GetValues(int presetId)
Parameters
presetId
intThe 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
settingPreset
SettingPresetThe SettingPreset.
SaveValues(IEnumerable<SettingPresetValue>)
Saves the Setting preset values.
public void SaveValues(IEnumerable<SettingPresetValue> presetValues)
Parameters
presetValues
IEnumerable<SettingPresetValue>The Setting preset values.