Table of Contents

Interface IContentType

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

Represents a Content Type information (the schema) used for IEntity objects.

[PublicApi]
public interface IContentType : IAppIdentityLight, IHasMetadata
Inherited Members

Properties

Attributes

All Attribute Definitions

IEnumerable<IContentTypeAttribute> Attributes { get; }

Property Value

IEnumerable<IContentTypeAttribute>

Remarks

As of v21, the order of attributes is preserved as defined in the content-type definition. Previously you had to manually sort using the .SortOrder property of the attribute.

Id

Get the id of the Content Type as stored in the DB. You usually don't need this!

int Id { get; }

Property Value

int

IsDynamic

Determines if the data for this type is dynamic (spontaneously created) or real an EAV (split into sql-tables) or json somewhere To detect if it's just a global json-type, find out what repository the type is from (RepositoryType)

bool IsDynamic { get; }

Property Value

bool

this[string]

A simple indexer to get an attribute

IContentTypeAttribute? this[string fieldName] { get; }

Parameters

fieldName string

Property Value

IContentTypeAttribute

The IContentTypeAttribute of the field name or null if not found

Metadata

Get the metadata for this content-type

IMetadata Metadata { get; }

Property Value

IMetadata

Remarks

The metadata is either already prepared, from the same app, or from a remote app

Name

Gets the Display Name of the Content Type

string Name { get; }

Property Value

string

NameId

A unique id/name of the content-type. Previously called StaticName.

string NameId { get; }

Property Value

string

Remarks

New in v13

RepositoryAddress

Information / ID / URL to this content-type where it was stored in the repository

string RepositoryAddress { get; }

Property Value

string

RepositoryType

Information where the Content-Type was stored (file system, DB, etc.)

RepositoryTypes RepositoryType { get; }

Property Value

RepositoryTypes

Scope

Get the scope of the Content Type (like sections in a DB)

string Scope { get; }

Property Value

string

Methods

Is(string?)

Check if this type is the same as a name given. Will check both the name and the static name

bool Is(string? name)

Parameters

name string

Returns

bool