Class MetaClassContentFactory
Creates CatalogContentBase instances based on a MetaClass.
Inheritance
Inherited Members
Namespace: EPiServer.Commerce.Catalog.Provider.Construction
Assembly: EPiServer.Business.Commerce.dll
Version: 10.8.0Syntax
public class MetaClassContentFactory
  Constructors
MetaClassContentFactory(MetaClassToContentTypeMap, MetaDataPropertyResolver, IContentFactory, IContentTypeRepository, CatalogLanguageLoader)
Initializes a new instance of the MetaClassContentFactory class.
Declaration
public MetaClassContentFactory(MetaClassToContentTypeMap metaClassMap, MetaDataPropertyResolver metaDataPropertyResolver, IContentFactory contentFactory, IContentTypeRepository contentTypeRepository, CatalogLanguageLoader languageLoader)
  Parameters
| Type | Name | Description | 
|---|---|---|
| MetaClassToContentTypeMap | metaClassMap | The meta class map.  | 
      
| MetaDataPropertyResolver | metaDataPropertyResolver | The meta data property resolver.  | 
      
| EPiServer.Construction.IContentFactory | contentFactory | The content factory.  | 
      
| EPiServer.DataAbstraction.IContentTypeRepository | contentTypeRepository | The content type repository.  | 
      
| CatalogLanguageLoader | languageLoader | The language loader.  | 
      
MetaClassContentFactory(MetaClassToContentTypeMap, MetaDataPropertyResolver, ContentFactory, IContentTypeRepository, CatalogLanguageLoader)
Initializes a new instance of the MetaClassContentFactory class.
Declaration
[Obsolete("This constructor depends on the implementation ContentFactory and obsoleted by the constructor taking the abstraction IContentFactory. Will remain at least until May 2017.")]
public MetaClassContentFactory(MetaClassToContentTypeMap metaClassMap, MetaDataPropertyResolver metaDataPropertyResolver, ContentFactory contentFactory, IContentTypeRepository contentTypeRepository, CatalogLanguageLoader languageLoader)
  Parameters
| Type | Name | Description | 
|---|---|---|
| MetaClassToContentTypeMap | metaClassMap | The meta class map.  | 
      
| MetaDataPropertyResolver | metaDataPropertyResolver | The meta data property resolver.  | 
      
| EPiServer.Construction.Internal.ContentFactory | contentFactory | The content factory.  | 
      
| EPiServer.DataAbstraction.IContentTypeRepository | contentTypeRepository | The content type repository.  | 
      
| CatalogLanguageLoader | languageLoader | The language loader.  | 
      
Methods
Create(String, Int32, String, Nullable<Int32>)
Creates a CatalogContentBase based on the specified metaClassId.
Declaration
public virtual CatalogContentBase Create(string baseEntryType, int metaClassId, string language, int? catalogId)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | baseEntryType | The base entry type, if any, used as fallback if no meta class matches.  | 
      
| System.Int32 | metaClassId | The meta class id.  | 
      
| System.String | language | The requested language, or null for master language.  | 
      
| System.Nullable<System.Int32> | catalogId | The catalog id.  | 
      
Returns
| Type | Description | 
|---|---|
| CatalogContentBase | A CatalogContentBase if any match is found; otherwise   | 
      
Create(Type, String, Nullable<Int32>)
Creates a CatalogContentBase based on the specified type.
Declaration
protected virtual CatalogContentBase Create(Type type, string language, int? catalogId)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.Type | type | The type.  | 
      
| System.String | language | The language.  | 
      
| System.Nullable<System.Int32> | catalogId | The catalog id.  | 
      
Returns
| Type | Description | 
|---|---|
| CatalogContentBase | 
Create<T>(String, Int32, Nullable<Int32>)
Creates an instance of type T and with properties from metafields.
Declaration
public virtual T Create<T>(string language, int metaClassId, int? catalogId)
    where T : CatalogContentBase
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | language | The requested language, or null for master language.  | 
      
| System.Int32 | metaClassId | The meta class id.  | 
      
| System.Nullable<System.Int32> | catalogId | The catalog id.  | 
      
Returns
| Type | Description | 
|---|---|
| T | A CatalogContentBase of type   | 
      
Type Parameters
| Name | Description | 
|---|---|
| T | The type to create  | 
      
Create<T>(String, Nullable<Int32>)
Creates an instance of type T.
Declaration
public virtual T Create<T>(string language, int? catalogId)
    where T : CatalogContentBase
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | language | The requested language, or null for master language.  | 
      
| System.Nullable<System.Int32> | catalogId | The catalog id.  | 
      
Returns
| Type | Description | 
|---|---|
| T | A CatalogContentBase of type   | 
      
Type Parameters
| Name | Description | 
|---|---|
| T | The type to create  |