• Basics
  • Abyss
  • Web APIs
  • C# & Razor
  • .net API
  • JS & TS API

    Show / Hide Table of Contents

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

    Inherited Members
    IConvertEntity<EavLightEntity>.Languages
    IConvert<IEntity, EavLightEntity>.Convert(IEnumerable<IEntity>)
    IConvert<IEntity, EavLightEntity>.Convert(IEntity)
    IConvert<IEntityWrapper, EavLightEntity>.Convert(IEnumerable<IEntityWrapper>)
    IConvert<IEntityWrapper, EavLightEntity>.Convert(IEntityWrapper)
    IConvert<Object, EavLightEntity>.Convert(IEnumerable<Object>)
    IConvert<Object, EavLightEntity>.Convert(Object)
    Namespace: ToSic.Eav.DataFormats.EavLight
    Assembly: ToSic.Eav.WebApi.dll
    Syntax
    [PublicApi]
    public interface IConvertToEavLight : IConvertEntity<EavLightEntity>, IConvert<IEntity, EavLightEntity>, IConvert<IEntityWrapper, EavLightEntity>, IConvert<object, EavLightEntity>, IConvertDataSource<EavLightEntity>
    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

    | Improve this Doc View Source

    Convert(IEnumerable<Object>)

    Declaration
    IEnumerable<EavLightEntity> Convert(IEnumerable<object> list)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<System.Object> list
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<EavLightEntity>
    | Improve this Doc View Source

    Convert(IEnumerable<IEntity>)

    Declaration
    IEnumerable<EavLightEntity> Convert(IEnumerable<IEntity> entities)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<IEntity> entities
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<EavLightEntity>
    | Improve this Doc View Source

    Convert(IEnumerable<IEntityWrapper>)

    Declaration
    IEnumerable<EavLightEntity> Convert(IEnumerable<IEntityWrapper> list)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<IEntityWrapper> list
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<EavLightEntity>
    | Improve this Doc View Source

    Convert(Object)

    Declaration
    EavLightEntity Convert(object item)
    Parameters
    Type Name Description
    System.Object item
    Returns
    Type Description
    EavLightEntity
    | Improve this Doc View Source

    Convert(IEntity)

    Declaration
    EavLightEntity Convert(IEntity entity)
    Parameters
    Type Name Description
    IEntity entity
    Returns
    Type Description
    EavLightEntity
    | Improve this Doc View Source

    Convert(IEntityWrapper)

    Declaration
    EavLightEntity Convert(IEntityWrapper item)
    Parameters
    Type Name Description
    IEntityWrapper item
    Returns
    Type Description
    EavLightEntity
    | Improve this Doc View Source

    Convert(IDataSource, IEnumerable<String>)

    Declaration
    IDictionary<string, IEnumerable<EavLightEntity>> Convert(IDataSource source, IEnumerable<string> streams = null)
    Parameters
    Type Name Description
    IDataSource source
    System.Collections.Generic.IEnumerable<System.String> streams
    Returns
    Type Description
    System.Collections.Generic.IDictionary<System.String, System.Collections.Generic.IEnumerable<EavLightEntity>>
    | Improve this Doc View Source

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

    Declaration
    IDictionary<string, IEnumerable<EavLightEntity>> Convert(IDataSource source, IEnumerable<string> streams, string[] filterGuids)
    Parameters
    Type Name Description
    IDataSource source
    System.Collections.Generic.IEnumerable<System.String> streams
    System.String[] filterGuids
    Returns
    Type Description
    System.Collections.Generic.IDictionary<System.String, System.Collections.Generic.IEnumerable<EavLightEntity>>
    | Improve this Doc View Source

    Convert(IDataSource, String)

    Declaration
    IDictionary<string, IEnumerable<EavLightEntity>> Convert(IDataSource source, string streams)
    Parameters
    Type Name Description
    IDataSource source
    System.String streams
    Returns
    Type Description
    System.Collections.Generic.IDictionary<System.String, System.Collections.Generic.IEnumerable<EavLightEntity>>
    • Improve this Doc
    • View Source
    Back to top Generated by DocFX