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
Convert(IEnumerable<IEntityWrapper>)
IEnumerable<EavLightEntity> Convert(IEnumerable<IEntityWrapper> list)
Parameters
list
IEnumerable<IEntityWrapper>
Returns
Convert(IEnumerable<IEntity>)
IEnumerable<EavLightEntity> Convert(IEnumerable<IEntity> entities)
Parameters
entities
IEnumerable<IEntity>
Returns
Convert(object)
EavLightEntity Convert(object item)
Parameters
item
object
Returns
Convert(IEntity)
EavLightEntity Convert(IEntity entity)
Parameters
entity
IEntity
Returns
Convert(IEntityWrapper)
EavLightEntity Convert(IEntityWrapper item)
Parameters
item
IEntityWrapper
Returns
Convert(IDataSource, IEnumerable<string>)
IDictionary<string, IEnumerable<EavLightEntity>> Convert(IDataSource source, IEnumerable<string> streams = null)
Parameters
source
IDataSourcestreams
IEnumerable<string>
Returns
Convert(IDataSource, IEnumerable<string>, string[])
IDictionary<string, IEnumerable<EavLightEntity>> Convert(IDataSource source, IEnumerable<string> streams, string[] filterGuids)
Parameters
source
IDataSourcestreams
IEnumerable<string>filterGuids
string[]
Returns
Convert(IDataSource, string)
IDictionary<string, IEnumerable<EavLightEntity>> Convert(IDataSource source, string streams)
Parameters
source
IDataSourcestreams
string