Table of Contents

Class DataModelAttribute

Namespace
ToSic.Sxc.Data.Model
Assembly
ToSic.Sxc.dll

BETA / WIP: Mark DataModel objects/interfaces and specify what ContentType they are for.

[InternalApi_DoNotUse_MayChangeWithoutNotice("may change or rename at any time")]
public class DataModelAttribute : Attribute
Inheritance
object
Attribute
DataModelAttribute

Remarks

Typical use is for custom data such as classes inheriting from CustomItem which takes an entity and then provides a strongly typed wrapper around it.

History: New / WIP in v19.01

Fields

ForAnyContentType

public const string ForAnyContentType = "*"

Field Value

string

Properties

ForContentTypes

Determines which content-type names are expected when converting to this data model.

public string ForContentTypes { get; init; }

Property Value

string

Remarks

Usually this is checked when converting Entities to the custom data model. If it doesn't match, will then throw an error.

Typically just one value, such as "Article" or "Product". But it will also support "*" for anything, or a comma-separated list of content-type names.

History: WIP 19.01

Remarks

Just custom remarks, no technical functionality.

public string Remarks { get; init; }

Property Value

string

StreamNames

public string StreamNames { get; init; }

Property Value

string