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
systemName
stringItem system name.
id
stringItem Id.
draft
boolIs item in a draft mode
previewDate
DateTimeDate 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
id
stringItem Id.
Returns
- T
Item with the given Id.
Type Parameters
T
Item 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
itemType
ItemTypeItem type.
ids
IEnumerable<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
systemName
stringItem system name.
ids
IEnumerable<string>Item Ids.
Returns
- IEnumerable<Item>
Items with the given Ids.
Open(ItemType)
Opens new repository.
public Repository Open(ItemType metadata)
Parameters
metadata
ItemTypeItem metadata.
Returns
- Repository
Repository.
Exceptions
- ArgumentNullException
metadata
is null.
Open(ItemType, bool)
public Repository Open(ItemType metadata, bool transactional)
Parameters
Returns
Open(string)
Opens new repository.
public Repository Open(string systemName)
Parameters
systemName
stringItem system name.
Returns
- Repository
Repository.
Open<T>()
Opens new repository.
public Repository Open<T>() where T : ItemEntry
Returns
- Repository
Repository.
Type Parameters
T
Item type.