Class ApiContentResponseBuilder
Default implementation of IApiContentResponseBuilder that builds content response objects for the Delivery API.
Namespace: Umbraco.Cms.Core.DeliveryApi
Assembly: Umbraco.Core.dll
Syntax
public class ApiContentResponseBuilder : ApiContentBuilderBase<IApiContentResponse>, IApiContentResponseBuilder
Constructors
View SourceApiContentResponseBuilder(IApiContentNameProvider, IApiContentRouteBuilder, IOutputExpansionStrategyAccessor, IVariationContextAccessor)
Initializes a new instance of the ApiContentResponseBuilder class.
Declaration
public ApiContentResponseBuilder(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. |
Methods
View SourceCreate(IPublishedContent, string, IApiContentRoute, IDictionary<string, object?>)
Creates an API content instance from the specified parameters.
Declaration
protected override IApiContentResponse 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 |
|---|---|
| IApiContentResponse | An API content instance. |
GetCultures(IPublishedContent)
Gets the available culture routes for the specified content.
Declaration
protected virtual IDictionary<string, IApiContentRoute> GetCultures(IPublishedContent content)
Parameters
| Type | Name | Description |
|---|---|---|
| IPublishedContent | content | The published content to get culture routes for. |
Returns
| Type | Description |
|---|---|
| IDictionary<string, IApiContentRoute> | A dictionary of culture codes to their corresponding routes. |