C# Class Felinesoft.UmbracoCodeFirst.Content.Factories.ContentFactoryBase

Creates an instance of a document type using values supplied as a strongly-typed model.

The RootContentFactory and ChildContentFactory[T] implementations work with the IAutoContent interface and the [AutoContent] attribute to place the content creation logic into methods on the code-first document type model. The recommended route to content generation is to implement IAutoContent on the document type model and apply an [AutoContent] attribute to the document type model.

Implementing a custom factory may be required for some scenarios such as creating a collection of content items or creating a nested structure in a single factory. A custom factory type can be specified using a [ContentFactory] attribute.

Inheritance: IContentFactory
Afficher le fichier Open project: DanMannMann/UmbracoCodeFirst

Méthodes publiques

Méthode Description
GetIfExists ( ) : Umbraco.Core.Models.IContent

Gets the IContent instance if it exists, otherwise returns null

GetOrCreate ( ) : Umbraco.Core.Models.IContent

Gets the IContent instance if it already exists, otherwise creates it

GetPublishedIfExists ( ) : IPublishedContent

Gets the IPublishedContent instance if it exists, otherwise returns null

Méthodes protégées

Méthode Description
ContentFactoryBase ( DocumentTypeBase values ) : System

Creates an instance of a document type using values supplied as a strongly-typed model.

The RootContentFactory and ChildContentFactory[T] implementations work with the IAutoContent interface and the [AutoContent] attribute to place the content creation logic into methods on the code-first document type model. The recommended approach for content creation is to implement IAutoContent on the document type model and apply an [AutoContent] attribute to the document type model.

Implementing a custom factory may be required for some scenarios such as creating a collection of content items or creating a nested structure in a single factory. A custom factory type can be specified using a [ContentFactory] attribute.

GetIfExists ( IEnumerable rootContent ) : Umbraco.Core.Models.IContent

Gets the IContent instance if it exists, otherwise returns null

GetOrCreate ( int parentId ) : Umbraco.Core.Models.IContent

Gets the IContent instance if it already exists, otherwise creates it

GetPublishedIfExists ( IEnumerable rootContent ) : IPublishedContent

Gets the IPublishedContent instance if it exists, otherwise returns null

Method Details

ContentFactoryBase() protected méthode

Creates an instance of a document type using values supplied as a strongly-typed model.

The RootContentFactory and ChildContentFactory[T] implementations work with the IAutoContent interface and the [AutoContent] attribute to place the content creation logic into methods on the code-first document type model. The recommended approach for content creation is to implement IAutoContent on the document type model and apply an [AutoContent] attribute to the document type model.

Implementing a custom factory may be required for some scenarios such as creating a collection of content items or creating a nested structure in a single factory. A custom factory type can be specified using a [ContentFactory] attribute.

protected ContentFactoryBase ( DocumentTypeBase values ) : System
values DocumentTypeBase The values to use to create the document
Résultat System

GetIfExists() public abstract méthode

Gets the IContent instance if it exists, otherwise returns null
public abstract GetIfExists ( ) : Umbraco.Core.Models.IContent
Résultat Umbraco.Core.Models.IContent

GetIfExists() protected méthode

Gets the IContent instance if it exists, otherwise returns null
protected GetIfExists ( IEnumerable rootContent ) : Umbraco.Core.Models.IContent
rootContent IEnumerable The collection of content to search for the existing node.
Résultat Umbraco.Core.Models.IContent

GetOrCreate() public abstract méthode

Gets the IContent instance if it already exists, otherwise creates it
public abstract GetOrCreate ( ) : Umbraco.Core.Models.IContent
Résultat Umbraco.Core.Models.IContent

GetOrCreate() protected méthode

Gets the IContent instance if it already exists, otherwise creates it
protected GetOrCreate ( int parentId ) : Umbraco.Core.Models.IContent
parentId int The ID of the parent node
Résultat Umbraco.Core.Models.IContent

GetPublishedIfExists() public abstract méthode

Gets the IPublishedContent instance if it exists, otherwise returns null
public abstract GetPublishedIfExists ( ) : IPublishedContent
Résultat IPublishedContent

GetPublishedIfExists() protected méthode

Gets the IPublishedContent instance if it exists, otherwise returns null
protected GetPublishedIfExists ( IEnumerable rootContent ) : IPublishedContent
rootContent IEnumerable The collection of content to search for the existing node.
Résultat IPublishedContent