Table of Contents

Interface IConvertToEavLight

Namespace
ToSic.Eav.DataFormats.EavLight
Assembly
ToSic.Eav.WebApi.dll

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>();

[PublicApi]
public interface IConvertToEavLight : IConvertEntity<EavLightEntity>, IConvert<IEntity, EavLightEntity>, IConvert<IEntityWrapper, EavLightEntity>, IConvert<object, EavLightEntity>, IHasLog
Inherited Members

Remarks

We're standardizing how conversions are done using the IConvert<TFrom, TTo> interface. This is why you don't see any methods on this interface in the docs. In most cases you'll just do var prepared = converter.Convert(someEntityObjectOrList);

Methods

Convert(IEnumerable<object>)

IEnumerable<EavLightEntity> Convert(IEnumerable<object> list)

Parameters

list IEnumerable<dynamic>

Returns

IEnumerable<EavLightEntity>

Convert(IEnumerable<IEntityWrapper>)

IEnumerable<EavLightEntity> Convert(IEnumerable<IEntityWrapper> list)

Parameters

list IEnumerable<IEntityWrapper>

Returns

IEnumerable<EavLightEntity>

Convert(IEnumerable<IEntity>)

IEnumerable<EavLightEntity> Convert(IEnumerable<IEntity> entities)

Parameters

entities IEnumerable<IEntity>

Returns

IEnumerable<EavLightEntity>

Convert(object)

EavLightEntity Convert(object item)

Parameters

item object

Returns

EavLightEntity

Convert(IEntity)

EavLightEntity Convert(IEntity entity)

Parameters

entity IEntity

Returns

EavLightEntity

Convert(IEntityWrapper)

EavLightEntity Convert(IEntityWrapper item)

Parameters

item IEntityWrapper

Returns

EavLightEntity

Convert(IDataSource, IEnumerable<string>)

IDictionary<string, IEnumerable<EavLightEntity>> Convert(IDataSource source, IEnumerable<string> streams = null)

Parameters

source IDataSource
streams IEnumerable<string>

Returns

IDictionary<string, IEnumerable<EavLightEntity>>

Convert(IDataSource, IEnumerable<string>, string[])

IDictionary<string, IEnumerable<EavLightEntity>> Convert(IDataSource source, IEnumerable<string> streams, string[] filterGuids)

Parameters

source IDataSource
streams IEnumerable<string>
filterGuids string[]

Returns

IDictionary<string, IEnumerable<EavLightEntity>>

Convert(IDataSource, string)

IDictionary<string, IEnumerable<EavLightEntity>> Convert(IDataSource source, string streams)

Parameters

source IDataSource
streams string

Returns

IDictionary<string, IEnumerable<EavLightEntity>>