Class StorageManager
- Namespace
- Dynamicweb.Content.Items.Queries
- Assembly
- Dynamicweb.dll
Represents a storage manager. This class cannot be inherited.
public sealed class StorageManager
- Inheritance
-
StorageManager
- Inherited Members
Properties
Current
Gets the current instance of the storage manager.
public static StorageManager Current { get; }
Property Value
Methods
GetById(string, string)
Selects the item by its Id.
public Item? GetById(string systemName, string id)
Parameters
Returns
- Item
Item with the given Id.
Remarks
Item is cached for 15 minutes
GetById(string, string, bool, DateTime)
Selects the item by its Id.
public Item? GetById(string systemName, string id, bool draft, DateTime previewDate)
Parameters
systemNamestringItem system name.
idstringItem Id.
draftboolIs item in a draft mode
previewDateDateTimeDate to preview the content from
Returns
- Item
Item with the given Id.
GetById<T>(string)
Selects the item by its Id.
public T? GetById<T>(string id) where T : ItemEntry, new()
Parameters
idstringItem Id.
Returns
- T
Item with the given Id.
Type Parameters
TItem type.
Remarks
Uses the db to find the item
GetByIds(ItemType, IEnumerable<string>)
Get items by their Ids.
public IEnumerable<Item> GetByIds(ItemType itemType, IEnumerable<string> ids)
Parameters
itemTypeItemTypeItem type.
idsIEnumerable<string>Item Ids.
Returns
- IEnumerable<Item>
Items with the given Ids.
GetByIds(string, IEnumerable<string>)
Get items by their Ids.
public IEnumerable<Item> GetByIds(string systemName, IEnumerable<string> ids)
Parameters
systemNamestringItem system name.
idsIEnumerable<string>Item Ids.
Returns
- IEnumerable<Item>
Items with the given Ids.
Open(ItemType)
Opens new repository.
public Repository Open(ItemType metadata)
Parameters
metadataItemTypeItem metadata.
Returns
- Repository
Repository.
Exceptions
- ArgumentNullException
metadatais null.
Open(ItemType, bool)
public Repository Open(ItemType metadata, bool transactional)
Parameters
Returns
Open(string)
Opens new repository.
public Repository Open(string systemName)
Parameters
systemNamestringItem system name.
Returns
- Repository
Repository.
Open<T>()
Opens new repository.
public Repository Open<T>() where T : ItemEntry
Returns
- Repository
Repository.
Type Parameters
TItem type.