Class EntityAssembler
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
-
objectEntityAssembler
- 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
appIdintcontentTypeIContentTypenpoNoParamOrderattributesIReadOnlyDictionary<string, IAttribute>entityIdintrepositoryIdintguidGuidtitleFieldstringcreatedDateTime?modifiedDateTime?ownerstringversionintisPublishedboolmetadataForITargetpartsBuilderEntityPartsLazypublishedIdint
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
originalIEntitynpoNoParamOrderappIdint?attributesIReadOnlyDictionary<string, IAttribute>idint?repositoryIdint?guidGuid?typeIContentTypeisPublishedbool?createdDateTime?modifiedDateTime?ownerstringversionint?targetITargetpublishedIdint?partsBuilderEntityPartsLazy
Returns
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
Exceptions
- ServiceOptionsRequiredException