Class Repository
- Namespace
- Dynamicweb.Content.Items.Queries
- Assembly
- Dynamicweb.dll
Represents a relational database repository.
- Inheritance
-
Repository
- Implements
- Inherited Members
Constructors
Repository(ItemType)
Initializes a new instance of an object.
Parameters
metadata
ItemType Metadata of an item this repository is currently working with.
Exceptions
- Argument
Null Exception metadata
is null.- Argument
Exception The SysteName property of a given item metadata is null or an empty string.
Repository(string)
Initializes a new instance of an object.
Parameters
systemName
stringSystem name of the target item.
Properties
BaseMetadata
Gets the collection of base metadata of an metadata this repository is currently working with.
Property Value
DerivedMetadata
Gets the collection of detived metadata of an metadata this repository is currently working with.
Property Value
Metadata
Gets the metadata of an item this repository is currently working with.
Property Value
ValueConverter
Gets the value converter that is used to convert values from one representation into another one.
Property Value
Methods
Delete(ItemEntry)
Deletes the given item.
Parameters
item
ItemEntry Item to delete.
Delete(ItemEntry, ItemContext?)
Deletes the given item.
Parameters
item
ItemEntry Item to delete.
context
ItemContext Execution context.
Delete(IEnumerable<ItemEntry>)
Deletes the given items.
Parameters
items
IEnumerable<ItemEntry >Items to delete.
Delete(IEnumerable<ItemEntry>, ItemContext?)
Deletes the given items.
Parameters
items
IEnumerable<ItemEntry >Items to delete.
context
ItemContext Execution context.
DeleteById(IEnumerable<string>)
Deletes all items with the given Ids.
Parameters
ids
IEnumerable<string>Item Ids.
DeleteById(IEnumerable<string>, bool)
Deletes all items with the given Ids.
Parameters
ids
IEnumerable<string>Item Ids.
cleanup
boolClean item info from related page/paragraph entry or not.
DeleteById(string)
Deletes an item with the given Id.
Parameters
id
stringItem Id.
DeleteById(string, bool)
Deletes an item with the given Id.
Parameters
DeleteByPageId(IEnumerable<int>)
Deletes all items with the given page Ids.
Parameters
pageIds
IEnumerable<int>Page Ids.
DeleteByPageId(int)
Deletes all items with the given page Id.
Parameters
pageId
intPage Id.
DeleteByParagraphId(IEnumerable<int>)
Deletes all items with the given paragraph Ids.
Parameters
paragraphIds
IEnumerable<int>Paragraph Ids.
DeleteByParagraphId(int)
Deletes all items with the given paragraph Id.
Parameters
paragraphId
intParagraph Id.
Dispose()
Disposes all managed resources used by this repository.
Execute<TResult>(string)
Executes the given named command and returns the result of an execution.
Parameters
command
stringCommand name.
Returns
- TResult
The result of a command execution.
Type Parameters
TResult
Result type.
Exceptions
- Not
Supported Exception Specified command is not supported.
Execute<TResult>(string, params object?[]?)
Executes the given named command and returns the result of an execution.
Parameters
Returns
- TResult
The result of a command execution.
Type Parameters
TResult
Result type.
Exceptions
- Not
Supported Exception Specified command is not supported.
GetFullQualifiedColumnName(ItemField)
Parameters
field
ItemField
Returns
GetFullQualifiedPrimaryKeyName(ItemType)
Parameters
metadata
ItemType
Returns
OnDisposing()
Called when the managed resources needs to be disposed.
ReadValue(ItemEntry, SystemField)
Reads field value from the given item.
Parameters
item
ItemEntry Item to read field value from.
field
SystemField Field.
Returns
- object
Field value.
ReadValue(ItemEntry, string)
Reads field value from the given item.
Parameters
Returns
- object
Field value.
ReadValue<T>(ItemEntry, SystemField)
Reads field value from the given item.
Parameters
item
ItemEntry Item to read field value from.
field
SystemField Field.
Returns
- T
Field value.
Type Parameters
T
Value type.
ReadValue<T>(ItemEntry, string)
Reads field value from the given item.
Parameters
Returns
- T
Field value.
Type Parameters
T
Value type.
SelectAll()
Selects all items.
Returns
- IEnumerable<Item>
All items.
SelectByAreaId(int)
Selects all items by the given language/area Id.
Parameters
areaId
intArea Id.
Returns
- IEnumerable<Item>
Items.
SelectByAreaId(int, Query?)
Selects all items by the given language/area Id.
Parameters
Returns
- IEnumerable<Item>
Items.
SelectByAreaId(int, Query?, bool)
Selects all items by the given language/area Id.
Parameters
areaId
intArea Id.
query
QueryQuery that is used to provide additional constraints.
includeParagraphs
boolAre paragraphs included.
Returns
- IEnumerable<Item>
Items.
SelectByAreaId(int, Query?, bool, bool)
Selects all items by the given language/area Id.
public virtual IEnumerable<Item> SelectByAreaId(int areaId, Query? query, bool includeParagraphs, bool checkPermissions)
Parameters
areaId
intArea Id.
query
QueryQuery that is used to provide additional constraints.
includeParagraphs
boolAre paragraphs included.
checkPermissions
bool
Returns
- IEnumerable<Item>
Items.
SelectByAreaId(int, Query?, bool, bool, bool)
Selects all items by the given language/area Id.
public virtual IEnumerable<Item> SelectByAreaId(int areaId, Query? query, bool includeParagraphs, bool checkPermissions, bool includeInheritedItems)
Parameters
areaId
intArea Id.
query
QueryQuery that is used to provide additional constraints.
includeParagraphs
boolAre paragraphs included.
checkPermissions
boolincludeInheritedItems
bool
Returns
- IEnumerable<Item>
Items.
SelectByAreaId<T>(int)
Selects all items by the given language/area Id.
Parameters
areaId
intArea Id.
Returns
- IEnumerable<T>
Items.
Type Parameters
T
SelectByAreaId<T>(int, Query?)
Selects all items by the given language/area Id.
public virtual IEnumerable<T> SelectByAreaId<T>(int areaId, Query? query) where T : ItemEntry, new()
Parameters
Returns
- IEnumerable<T>
Items.
Type Parameters
T
SelectById(string)
Selects the item by its Id.
Parameters
id
stringItem Id.
Returns
- Item
Item with the given Id.
SelectById(string, Query?)
Selects the item by its Id.
Parameters
Returns
- Item
Item with the given Id.
SelectById<T>(string)
Selects the item by its Id.
Parameters
id
stringItem Id.
Returns
- T
Item with the given Id.
Type Parameters
T
SelectById<T>(string, Query?)
Selects the item by its Id.
Parameters
Returns
- T
Item with the given Id.
Type Parameters
T
SelectByIds(IEnumerable<string>)
Selects items by their Ids.
Parameters
ids
IEnumerable<string>Item Ids.
Returns
- IEnumerable<Item>
Items with the given Ids.
SelectByIds(IEnumerable<string>, Query?)
Selects items by their Ids.
Parameters
ids
IEnumerable<string>Item Ids.
query
QueryQuery that is used to provide additional constraints.
Returns
- IEnumerable<Item>
Items with the given Ids.
SelectByIds(IEnumerable<string>, Query?, bool)
Selects items by their Ids.
public virtual IEnumerable<Item> SelectByIds(IEnumerable<string> ids, Query? query, bool checkPermissions)
Parameters
ids
IEnumerable<string>Item Ids.
query
QueryQuery that is used to provide additional constraints.
checkPermissions
boolTo check permissions of current user.
Returns
- IEnumerable<Item>
Items with the given Ids.
SelectByIds(IEnumerable<string>, Query?, bool, bool)
Selects items by their Ids.
public virtual IEnumerable<Item> SelectByIds(IEnumerable<string> ids, Query? query, bool checkPermissions, bool includeInheritedItems)
Parameters
ids
IEnumerable<string>Item Ids.
query
QueryQuery that is used to provide additional constraints.
checkPermissions
boolTo check permissions of current user.
includeInheritedItems
bool
Returns
- IEnumerable<Item>
Items with the given Ids.
SelectByIds<T>(IEnumerable<string>)
Selects items by their Ids.
Parameters
ids
IEnumerable<string>Item Ids.
Returns
- IEnumerable<T>
Items with the given Ids.
Type Parameters
T
SelectByIds<T>(IEnumerable<string>, Query?)
Selects items by their Ids.
public virtual IEnumerable<T> SelectByIds<T>(IEnumerable<string> ids, Query? query) where T : ItemEntry, new()
Parameters
ids
IEnumerable<string>Item Ids.
query
QueryQuery that is used to provide additional constraints.
Returns
- IEnumerable<T>
Items with the given Ids.
Type Parameters
T
Item type.
SelectByNamedListId(int, Query?, bool)
Selects all items by the given named list Id.
public virtual IEnumerable<Item> SelectByNamedListId(int namedListId, Query? query, bool checkPermissions)
Parameters
Returns
- IEnumerable<Item>
Items.
SelectByPageId(IEnumerable<int>)
Selects all items by the given page Id.
Parameters
pageIds
IEnumerable<int>Page Ids.
Returns
- IEnumerable<Item>
Items.
SelectByPageId(IEnumerable<int>, Query?)
Selects all items by the given page Id.
Parameters
pageIds
IEnumerable<int>Page Ids.
query
QueryQuery that is used to provide additional constraints.
Returns
- IEnumerable<Item>
Items.
SelectByPageId(int)
Selects all items by the given page Id.
Parameters
pageId
intPage Id.
Returns
- IEnumerable<Item>
Items.
SelectByPageId(int, Query?)
Selects all items by the given page Id.
Parameters
Returns
- IEnumerable<Item>
Items.
SelectByPageId<T>(IEnumerable<int>)
Selects all items by the given page Id.
public virtual IEnumerable<T> SelectByPageId<T>(IEnumerable<int> pageIds) where T : ItemEntry, new()
Parameters
pageIds
IEnumerable<int>Page Ids.
Returns
- IEnumerable<T>
Items.
Type Parameters
T
SelectByPageId<T>(IEnumerable<int>, Query?)
Selects all items by the given page Id.
public virtual IEnumerable<T> SelectByPageId<T>(IEnumerable<int> pageIds, Query? query) where T : ItemEntry, new()
Parameters
pageIds
IEnumerable<int>Page Ids.
query
QueryQuery that is used to provide additional constraints.
Returns
- IEnumerable<T>
Items.
Type Parameters
T
SelectByPageId<T>(int)
Selects all items by the given page Id.
Parameters
pageId
intPage Id.
Returns
- IEnumerable<T>
Items.
Type Parameters
T
SelectByPageId<T>(int, Query?)
Selects all items by the given page Id.
public virtual IEnumerable<T> SelectByPageId<T>(int pageId, Query? query) where T : ItemEntry, new()
Parameters
Returns
- IEnumerable<T>
Items.
Type Parameters
T
SelectByParagraphId(IEnumerable<int>)
Selects all items by the given page Id.
Parameters
paragraphIds
IEnumerable<int>Paragraph Ids.
Returns
- IEnumerable<Item>
Items.
SelectByParagraphId(IEnumerable<int>, Query?)
Selects all items by the given paragraph Id.
Parameters
paragraphIds
IEnumerable<int>Paragraph Ids.
query
QueryQuery that is used to provide additional constraints.
Returns
- IEnumerable<Item>
Items.
SelectByParagraphId(int)
Selects all items by the given page Id.
Parameters
paragraphId
intParagraph Id.
Returns
- IEnumerable<Item>
Items.
SelectByParagraphId(int, Query?)
Selects all items by the given paragraph Id.
Parameters
Returns
- IEnumerable<Item>
Items.
SelectByParagraphId<T>(IEnumerable<int>)
Selects all items by the given paragraph Id.
public virtual IEnumerable<T> SelectByParagraphId<T>(IEnumerable<int> paragraphIds) where T : ItemEntry, new()
Parameters
paragraphIds
IEnumerable<int>Paragraph Ids.
Returns
- IEnumerable<T>
Items.
Type Parameters
T
SelectByParagraphId<T>(IEnumerable<int>, Query?)
Selects all items by the given paragraph Id.
public virtual IEnumerable<T> SelectByParagraphId<T>(IEnumerable<int> paragraphIds, Query? query) where T : ItemEntry, new()
Parameters
paragraphIds
IEnumerable<int>Paragraph Ids.
query
QueryQuery that is used to provide additional constraints.
Returns
- IEnumerable<T>
Items.
Type Parameters
T
SelectByParagraphId<T>(int)
Selects all items by the given paragraph Id.
Parameters
paragraphId
intParagraph Id.
Returns
- IEnumerable<T>
Items.
Type Parameters
T
SelectByParagraphId<T>(int, Query?)
Selects all items by the given paragraph Id.
public virtual IEnumerable<T> SelectByParagraphId<T>(int paragraphId, Query? query) where T : ItemEntry, new()
Parameters
Returns
- IEnumerable<T>
Items.
Type Parameters
T
SelectByParentPageId(int)
Selects all items by the given parent page Id.
Parameters
pageId
intPage Id.
Returns
- IEnumerable<Item>
Items.
SelectByParentPageId(int, Query?)
Selects all items by the given parent page Id.
Parameters
Returns
- IEnumerable<Item>
Items.
SelectByParentPageId(int, Query?, bool, bool)
Selects all items by the given parent page Id including all childs.
public virtual IEnumerable<Item> SelectByParentPageId(int pageId, Query? query, bool includeParagraphs, bool includeAllChildItems)
Parameters
pageId
intPage Id.
query
QueryQuery that is used to provide additional constraints.
includeParagraphs
boolAre paragraphs included.
includeAllChildItems
boolAre all childs included.
Returns
- IEnumerable<Item>
Items.
SelectByParentPageId(int, Query?, bool, bool, bool)
Selects all items by the given parent page Id including all childs.
public virtual IEnumerable<Item> SelectByParentPageId(int pageId, Query? query, bool includeParagraphs, bool includeAllChildItems, bool checkPermissions)
Parameters
pageId
intPage Id.
query
QueryQuery that is used to provide additional constraints.
includeParagraphs
boolAre paragraphs included.
includeAllChildItems
boolAre all childs included.
checkPermissions
bool
Returns
- IEnumerable<Item>
Items.
SelectByParentPageId<T>(int)
Selects all items by the given parent page Id.
Parameters
pageId
intPage Id.
Returns
- IEnumerable<T>
Items.
Type Parameters
T
SelectByParentPageId<T>(int, Query?)
Selects all items by the given parent page Id.
public virtual IEnumerable<T> SelectByParentPageId<T>(int pageId, Query? query) where T : ItemEntry, new()
Parameters
Returns
- IEnumerable<T>
Items.
Type Parameters
T
SelectByParentPageIds(IEnumerable<int>, Query?, bool, bool, bool)
Selects all items by the given a list of parent pages Ids including all children.
public virtual IEnumerable<Item> SelectByParentPageIds(IEnumerable<int> parentIds, Query? query, bool includeParagraphs, bool includeChildItems, bool checkPermissions)
Parameters
parentIds
IEnumerable<int>List of parent Ids.
query
QueryQuery that is used to provide additional constraints.
includeParagraphs
boolAre paragraphs included.
includeChildItems
boolAre all children included.
checkPermissions
bool
Returns
- IEnumerable<Item>
Items.
SelectByParentPageIds(IEnumerable<int>, Query?, bool, bool, bool, bool)
Selects all items by the given a list of parent pages Ids including all childs.
public virtual IEnumerable<Item> SelectByParentPageIds(IEnumerable<int> parentIds, Query? query, bool includeParagraphs, bool includeChildItems, bool checkPermissions, bool includeInheritedItems)
Parameters
parentIds
IEnumerable<int>List of parent Ids.
query
QueryQuery that is used to provide additional constraints.
includeParagraphs
boolAre paragraphs included.
includeChildItems
boolAre all children included.
checkPermissions
boolincludeInheritedItems
bool
Returns
- IEnumerable<Item>
Items.
SelectByReference(string, string, string, Query, bool, bool)
Find all items that references a given item in a given field.
public virtual IEnumerable<Item> SelectByReference(string sourceFieldName, string targetItemType, string targetItemId, Query query, bool includeParagraphs, bool checkPermissions)
Parameters
sourceFieldName
stringName of the field on the source item
targetItemType
stringItem type of the target item
targetItemId
stringId of the target item
query
QueryincludeParagraphs
boolcheckPermissions
bool
Returns
SynchronizePageStructure(Item, bool, Item?)
Synchronize changes in items with pages
public void SynchronizePageStructure(Item currentItem, bool updateModificationDate, Item? originalItem)
Parameters
SynchronizePageStructure(Item, bool, Item?, ItemContext?)
Synchronize changes in items with pages
public void SynchronizePageStructure(Item currentItem, bool updateModificationDate, Item? originalItem, ItemContext? context)
Parameters
currentItem
ItemupdateModificationDate
booloriginalItem
Itemcontext
ItemContext
Update(ItemEntry)
Either inserts new or updates existing record that correspond to the given item.
Parameters
item
ItemEntry Item to insert/update.
Returns
- string
An Id of the item that was inserted/updated.
Update(ItemEntry, ItemContext?)
Either inserts new or updates existing record that correspond to the given item.
Parameters
item
ItemEntry Item to insert/update.
context
ItemContext Context of the item.
Returns
- string
An Id of the item that was inserted/updated.
Update(IEnumerable<ItemEntry>)
Either inserts new or updates existing records that correspond to the given items.
Parameters
items
IEnumerable<ItemEntry >Items to insert/update.
Remarks
If the list contains only one item, the Id of the item is updated in case it was inserted.
Update(IEnumerable<ItemEntry>, ItemContext?)
Either inserts new or updates existing records that correspond to the given items.
Parameters
items
IEnumerable<ItemEntry >Items to insert/update.
context
ItemContext Context of the items.
Remarks
If the list contains only one item, the Id of the item is updated in case it was inserted.
Update(IEnumerable<ItemEntry>, ItemContext?, bool)
Either inserts new or updates existing records that correspond to the given items.
public virtual void Update(IEnumerable<ItemEntry> items, ItemContext? context, bool synchronizePages)
Parameters
items
IEnumerable<ItemEntry >Items to insert/update.
context
ItemContext Context of the items.
synchronizePages
boolSynchronize pages after update
Remarks
If the list contains only one item, the Id of the item is updated in case it was inserted.