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
파일 보기 프로젝트 열기: DanMannMann/UmbracoCodeFirst

공개 메소드들

메소드 설명
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