Class ApiContentBuilderBase<T>
Base class for building IApiContent instances from published content.
Inheritance
object
Namespace: Umbraco.Cms.Core.DeliveryApi
Assembly: Umbraco.Core.dll
Syntax
public abstract class ApiContentBuilderBase<T> where T : IApiContent
Type Parameters
| Name | Description |
|---|---|
| T | The type of API content to build. |
Constructors
View SourceApiContentBuilderBase(IApiContentNameProvider, IApiContentRouteBuilder, IOutputExpansionStrategyAccessor, IVariationContextAccessor)
Initializes a new instance of the ApiContentBuilderBase<T> class.
Declaration
protected ApiContentBuilderBase(IApiContentNameProvider apiContentNameProvider, IApiContentRouteBuilder apiContentRouteBuilder, IOutputExpansionStrategyAccessor outputExpansionStrategyAccessor, IVariationContextAccessor variationContextAccessor)
Parameters
| Type | Name | Description |
|---|---|---|
| IApiContentNameProvider | apiContentNameProvider | The API content name provider. |
| IApiContentRouteBuilder | apiContentRouteBuilder | The API content route builder. |
| IOutputExpansionStrategyAccessor | outputExpansionStrategyAccessor | The output expansion strategy accessor. |
| IVariationContextAccessor | variationContextAccessor | The variation context accessor. |
Properties
View SourceApiContentRouteBuilder
Gets the API content route builder.
Declaration
protected IApiContentRouteBuilder ApiContentRouteBuilder { get; }
Property Value
| Type | Description |
|---|---|
| IApiContentRouteBuilder |
VariationContextAccessor
Gets the variation context accessor.
Declaration
protected IVariationContextAccessor VariationContextAccessor { get; }
Property Value
| Type | Description |
|---|---|
| IVariationContextAccessor |
Methods
View SourceBuild(IPublishedContent)
Builds an API content instance from the specified published content.
Declaration
public virtual T? Build(IPublishedContent content)
Parameters
| Type | Name | Description |
|---|---|---|
| IPublishedContent | content | The published content to build from. |
Returns
| Type | Description |
|---|---|
| T | An API content instance, or |
Create(IPublishedContent, string, IApiContentRoute, IDictionary<string, object?>)
Creates an API content instance from the specified parameters.
Declaration
protected abstract T Create(IPublishedContent content, string name, IApiContentRoute route, IDictionary<string, object?> properties)
Parameters
| Type | Name | Description |
|---|---|---|
| IPublishedContent | content | The published content. |
| string | name | The name of the content. |
| IApiContentRoute | route | The route of the content. |
| IDictionary<string, object> | properties | The properties of the content. |
Returns
| Type | Description |
|---|---|
| T | An API content instance. |