Table of Contents

Class EntityAssembler

Namespace
ToSic.Eav.Data.Build.Sys
Assembly
ToSic.Eav.Data.Build.dll

This is a helper environment to build entities based on different needs

[InternalApi_DoNotUse_MayChangeWithoutNotice]
public class EntityAssembler : ServiceWithSetup<DataAssemblerOptions>, IHasLog, IHasOptions<DataAssemblerOptions>, IServiceWithSetup<DataAssemblerOptions>
Inheritance
object
EntityAssembler
Implements
Inherited Members

Methods

Create(int, IContentType, NoParamOrder, IReadOnlyDictionary<string, IAttribute>?, int, int, Guid, string?, DateTime?, DateTime?, string?, int, bool, ITarget?, EntityPartsLazy?, int)

public Entity Create(int appId, IContentType contentType, NoParamOrder npo = default, IReadOnlyDictionary<string, IAttribute>? attributes = null, int entityId = 0, int repositoryId = -2742, Guid guid = default, string? titleField = null, DateTime? created = null, DateTime? modified = null, string? owner = null, int version = 0, bool isPublished = true, ITarget? metadataFor = null, EntityPartsLazy? partsBuilder = null, int publishedId = 0)

Parameters

appId int
contentType IContentType
npo NoParamOrder
attributes IReadOnlyDictionary<string, IAttribute>
entityId int
repositoryId int
guid Guid
titleField string
created DateTime?
modified DateTime?
owner string
version int
isPublished bool
metadataFor ITarget
partsBuilder EntityPartsLazy
publishedId int

Returns

Entity

CreateFrom(IEntity, NoParamOrder, int?, IReadOnlyDictionary<string, IAttribute>?, int?, int?, Guid?, IContentType?, bool?, DateTime?, DateTime?, string?, int?, ITarget?, int?, EntityPartsLazy?)

Create a new Entity based on an Entity and replacing some of its properties

public IEntity CreateFrom(IEntity original, NoParamOrder npo = default, int? appId = null, IReadOnlyDictionary<string, IAttribute>? attributes = null, int? id = null, int? repositoryId = null, Guid? guid = null, IContentType? type = null, bool? isPublished = null, DateTime? created = null, DateTime? modified = null, string? owner = null, int? version = null, ITarget? target = null, int? publishedId = null, EntityPartsLazy? partsBuilder = null)

Parameters

original IEntity
npo NoParamOrder
appId int?
attributes IReadOnlyDictionary<string, IAttribute>
id int?
repositoryId int?
guid Guid?
type IContentType
isPublished bool?
created DateTime?
modified DateTime?
owner string
version int?
target ITarget
publishedId int?
partsBuilder EntityPartsLazy

Returns

IEntity

GetDefaultOptions()

Method to generate new / default options. This should usually not be called, but it might; so if your service can work without valid options (or accesses options before setup), this would trigger.

This could also be triggered, if the service was created without the correct Generator. Note that it's always an option to just throw an exception.

You must override this to provide your own default options.

protected override DataAssemblerOptions GetDefaultOptions()

Returns

DataAssemblerOptions

Exceptions

ServiceOptionsRequiredException