C# Класс 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.

Наследование: IContentFactory
Показать файл Открыть проект

Открытые методы

Метод Описание
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

Защищенные методы

Метод Описание
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

Описание методов

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 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
Результат System

GetIfExists() публичный абстрактный Метод

Gets the IContent instance if it exists, otherwise returns null
public abstract GetIfExists ( ) : Umbraco.Core.Models.IContent
Результат Umbraco.Core.Models.IContent

GetIfExists() защищенный Метод

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.
Результат Umbraco.Core.Models.IContent

GetOrCreate() публичный абстрактный Метод

Gets the IContent instance if it already exists, otherwise creates it
public abstract GetOrCreate ( ) : Umbraco.Core.Models.IContent
Результат Umbraco.Core.Models.IContent

GetOrCreate() защищенный Метод

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
Результат Umbraco.Core.Models.IContent

GetPublishedIfExists() публичный абстрактный Метод

Gets the IPublishedContent instance if it exists, otherwise returns null
public abstract GetPublishedIfExists ( ) : IPublishedContent
Результат IPublishedContent

GetPublishedIfExists() защищенный Метод

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.
Результат IPublishedContent