Table of Contents

Class AttributeAssembler

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

Internal data assembler to create attributes.

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

Methods

CreateFrom(IAttribute, IImmutableList<IValue>)

public IAttribute CreateFrom(IAttribute original, IImmutableList<IValue> values)

Parameters

original IAttribute
values IImmutableList<IValue>

Returns

IAttribute

CreateOrUpdate(IAttribute?, string, object?, ValueTypes, IValue?, string?, bool)

Add a value to the attribute specified. To do so, set the name, type and string of the value, as well as some language properties.

public IAttribute CreateOrUpdate(IAttribute? originalOrNull, string name, object? value, ValueTypes type, IValue? valueToReplace = null, string? language = null, bool languageReadOnly = false)

Parameters

originalOrNull IAttribute
name string
value object
type ValueTypes
valueToReplace IValue
language string
languageReadOnly bool

Returns

IAttribute

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

Relationship(string, IEnumerable<IEntity?>)

public IAttribute<IEnumerable<IEntity>> Relationship(string name, IEnumerable<IEntity?> directSource)

Parameters

name string
directSource IEnumerable<IEntity>

Returns

IAttribute<IEnumerable<IEntity>>