Table of Contents

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

StorageManager

Methods

GetById(string, string)

Selects the item by its Id.
public Item GetById(string systemName, string id)

Parameters

systemName string
Item system name.
id string
Item Id.

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 string
Item system name.
id string
Item Id.
draft bool
Is item in a draft mode
previewDate DateTime
Date 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 string
Item 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 ItemType
Item 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 string
Item system name.
ids IEnumerable<string>
Item Ids.

Returns

IEnumerable<Item>
Items with the given Ids.

GetByPageId(string, int)

Selects all items by the given page Id.
[Obsolete("Use PageService instead and access the .Item property on the page instances to get hold of the item entry..", true)]
public ItemCollection GetByPageId(string systemName, int pageId)

Parameters

systemName string
Item system name.
pageId int
Page Id.

Returns

ItemCollection

GetByPageId<T>(int)

Selects all items by the given page Id.
[Obsolete("Use PageService instead and access the .Item property on the page instances to get hold of the item entry..", true)]
public ItemEntryCollection<T> GetByPageId<T>(int pageId) where T : ItemEntry, new()

Parameters

pageId int
Page Id.

Returns

ItemEntryCollection<T>
Items.

Type Parameters

T
Item type.

GetByParagraphId(string, int)

Selects all items by the given paragraph Id.
[Obsolete("Use ParagraphService instead and access the .Item property on the page instances to get hold of the item entry..", true)]
public ItemCollection GetByParagraphId(string systemName, int paragraphId)

Parameters

systemName string
Item system name.
paragraphId int
Paragraph Id.

Returns

ItemCollection

GetByParagraphId<T>(int)

Selects all items by the given paragraph Id.
[Obsolete("Use ParagraphService instead and access the .Item property on the page instances to get hold of the item entry..", true)]
public ItemEntryCollection<T> GetByParagraphId<T>(int paragraphId) where T : ItemEntry, new()

Parameters

paragraphId int
Paragraph Id.

Returns

ItemEntryCollection<T>

Type Parameters

T
Item type.

GetByParentPageId(string, int)

Selects all items by the given parent page Id.
[Obsolete("Use PageService instead and access the .Item property on the page instances to get hold of the item entry..", true)]
public ItemCollection GetByParentPageId(string systemName, int pageId)

Parameters

systemName string
Item system name.
pageId int
Parent page Id.

Returns

ItemCollection

GetByParentPageId<T>(int)

Selects all items by the given parent page Id.
[Obsolete("Use PageService.GetPagesByParentID instead and access the .Item property on the page instances to get hold of the item entry.", true)]
public ItemEntryCollection<T> GetByParentPageId<T>(int pageId) where T : ItemEntry, new()

Parameters

pageId int
Parent page Id.

Returns

ItemEntryCollection<T>

Type Parameters

T
Item type.

Open(ItemType)

Opens new repository.
public Repository Open(ItemType metadata)

Parameters

metadata ItemType
Item metadata.

Returns

Repository
Repository.

Exceptions

ArgumentNullException
metadata is null.

Open(ItemType, bool)

public Repository Open(ItemType metadata, bool transactional)

Parameters

metadata ItemType
transactional bool

Returns

Repository

Open(string)

Opens new repository.
public Repository Open(string systemName)

Parameters

systemName string
Item 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.
To top