Class CatalogMetaObjectRepository
Handles CRUD opreations for MetaObject instances for catalog meta classes.
Inheritance
Inherited Members
Namespace: Mediachase.MetaDataPlus.Internal
Assembly: Mediachase.MetaDataPlus.dll
Version: 10.8.0Syntax
public class CatalogMetaObjectRepository
Constructors
CatalogMetaObjectRepository(ISynchronizedObjectInstanceCache, ServiceAccessor<MetaDataContext>)
Initializes a new instance of the CatalogMetaObjectRepository class.
Declaration
public CatalogMetaObjectRepository(ISynchronizedObjectInstanceCache cache, ServiceAccessor<MetaDataContext> contextAccessor)
Parameters
Type | Name | Description |
---|---|---|
EPiServer.Framework.Cache.ISynchronizedObjectInstanceCache | cache | The cache. |
EPiServer.ServiceLocation.ServiceAccessor<MetaDataContext> | contextAccessor | The context accessor. |
Methods
Delete(MetaObject)
Deletes the specified meta object. It deletes all fields in CatalogContentPropery and all drafts of this content.
Declaration
public void Delete(MetaObject metaObject)
Parameters
Type | Name | Description |
---|---|---|
MetaObject | metaObject | The meta object. |
Load(Int32, Int32, IEnumerable<String>)
Loads language versions of a catalog meta object. It loads all user-defined fields of the meta object from the CatalogContentProperty table and extra info from CatalogContentEx table.
Declaration
public Dictionary<string, MetaObject> Load(int objectId, int metaClassId, IEnumerable<string> languages)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | objectId | The object (node/entry) ID.. |
System.Int32 | metaClassId | The meta class ID. |
System.Collections.Generic.IEnumerable<System.String> | languages | The languages. |
Returns
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.String, MetaObject> | The requested meta object if it exists; otherwise null. |
Load(Int32, Int32, String)
Loads a specific language version of a catalog meta object. It loads all user-defined fields of the meta object from the CatalogContentProperty table and extra info from CatalogContentEx table. If the requested language is not valid for the catalog, it will fall back to the catalog's default language.
Declaration
public MetaObject Load(int objectId, int metaClassId, string language)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | objectId | The object (node/entry) ID.. |
System.Int32 | metaClassId | The meta class ID. |
System.String | language | The language. |
Returns
Type | Description |
---|---|
MetaObject | The requested meta object if it exists; otherwise null. |
LoadBatch(IDictionary<Int32, IEnumerable<Int32>>, String)
Loads the a specific language version of a set of catalog meta object. It loads all user-defined fields of the meta object from the CatalogContentProperty table and extra info from CatalogContentEx table. If the requested language is not valid for the catalog, it will fall back to the catalog's default language.
Declaration
public IEnumerable<MetaObject> LoadBatch(IDictionary<int, IEnumerable<int>> objectIdsByClassId, string language)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IDictionary<System.Int32, System.Collections.Generic.IEnumerable<System.Int32>> | objectIdsByClassId | The object (node/entry) IDs grouped by meta class id. |
System.String | language | The language. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<MetaObject> | The existing meta objects, requested objects that don't exist are skipped. |
LoadMetaClass(MetaDataContext, Int32)
Loads the MetaClass.
Declaration
protected virtual MetaClass LoadMetaClass(MetaDataContext context, int metaClassId)
Parameters
Type | Name | Description |
---|---|---|
MetaDataContext | context | The metadata context. |
System.Int32 | metaClassId | The MetaClass id. |
Returns
Type | Description |
---|---|
MetaClass | The requested MetaClass if it exits; otherwise null. |
Update(MetaObject, String)
Updates the specified catalog meta object. It updates all user-defined fields of the meta object in CatalogContentProperty and extra info on CatalogContentEx table.
Declaration
public int Update(MetaObject metaObject, string language)
Parameters
Type | Name | Description |
---|---|---|
MetaObject | metaObject | The meta object. |
System.String | language | The language. |
Returns
Type | Description |
---|---|
System.Int32 | The meta object id. |
UpdateBatch(IDictionary<String, IEnumerable<MetaObject>>)
Updates batch of meta object. It updates all user-defined fields of the meta object in CatalogContentProperty and extra info on CatalogContentEx table.
Declaration
public void UpdateBatch(IDictionary<string, IEnumerable<MetaObject>> metaObjectsByLanguage)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IDictionary<System.String, System.Collections.Generic.IEnumerable<MetaObject>> | metaObjectsByLanguage | The meta objects grouped by language. |