Table of Contents

Class ContentTypeAttribute

Namespace
ToSic.Eav.Data.ContentTypes
Assembly
ToSic.Eav.Data.dll

Content type specifications when converting the schema of an object to a Content Type Definition.

[WorkInProgressApi("v22")]
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Interface)]
public class ContentTypeAttribute : Attribute
Inheritance
object
Attribute
ContentTypeAttribute

Remarks

This is mainly important to assign it a distinct name and GUID, mainly for marking the generated Entities to allow future auto-conversion to Models.

Properties

Description

Content type description. It's highly recommended for the future you who must diagnose something.

public string Description { get; set; }

Property Value

string

Guid

Content Type Guid required.

public required string Guid { get; set; }

Property Value

string

Remarks

Enter as a string, because GUIDs are not supported in C# attributes.

It will later be on the property ContentType.NameId.

Name

Content type name required. If not set, will use the class name.

public required string Name { get; set; }

Property Value

string

Scope

Content Type Scope - if blank, will default to "Default"

public string Scope { get; set; }

Property Value

string