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.

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