Table of Contents

Namespace ToSic.Eav.DataFormats.EavLight

The ToSic.Eav.Formats Namespace contain DTO-style objects which are meant for transferring or import/export of data.

Most of the formats are currently not publicly documented, as they can still change a bit.

Note that the formats themselves are more like DTO objects, so they can be serialized to JSON, XML or other future data formats.

EavLight

The EAV Light data format is very trivial, basically a dictionary with values. It's mainly used to serialize entities for use in JS etc. Internally it's used for some admin-dialogs, and custom Razor and Web-APIs usually use this to provide one or more entities for direct use - either as inline-JSON or to then automatically serialize.

Discover More in the Razor Tutorials

We have an rich series of Razor tutorials. You should really check them out 👍.


Classes

EavLightEntity

DTO for the most basic JSON format of EAV. It's a simple dictionary with name-value pairs. It is for export/serialization only, there is no official way to re-import an entity of this type.

It is only meant to hold values of one language.

Note that keys are always InvariantCultureIgnoreCase

EavLightEntityReference

DTO for a relationship pointer to other entities.

Used in preparing Entities for Basic-JSON serialization.

Interfaces

IConvertToEavLight

Helper / Service to prepare Entities, Streams and DataSources to ToSic.Eav.DataFormats.EavLight for automatic serialization in WebApis.

It can prepare single items like IEntity and ToSic.Eav.Data.IEntityWrapper like DynamicEntities. It can also prepare IEnumerable/List of these types, as well as DataStream and DataSource objects.

In Custom Code / Razor / WebApi you can get this service with Dependency Injection like
var converter = GetService<IConvertToEavLight>();