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

    Show / Hide Table of Contents

    Class CsvDataSource

    DataSource for importing/reading CSV files.

    The CSV DataSource is part of the Standard EAV Data Sources.

    It will load data from a CSV file which is usually located in the App folder (but can also be in ADAM).

    These docs are not complete, check out the feature description for now.

    History

    1. Introduced in 2sxc 7.2

    API Documentation

    Inheritance
    System.Object
    ToSic.Lib.Services.ServiceBase
    ToSic.Lib.Services.ServiceBase<DataSourceBase.MyServices>
    DataSourceBase
    CustomDataSourceAdvanced
    CsvDataSource
    Implements
    IDataSource
    IDataSourceSource
    IAppIdentity
    IZoneIdentity
    IAppIdentityLight
    ICacheKey
    ICacheExpiring
    ITimestamped
    IHasLog
    IDataSourceTarget
    IDataSourceShared
    IDataSourceLinkable
    Inherited Members
    CustomDataSourceAdvanced.CacheTimestamp
    CustomDataSourceAdvanced.DataFactory
    DataSourceBase.AppId
    DataSourceBase.ZoneId
    DataSourceBase.Guid
    DataSourceBase.Error
    DataSourceBase.CacheChanged(Int64)
    DataSourceBase.Configuration
    DataSourceBase.Link
    DataSourceBase.In
    DataSourceBase.TryGetIn(String)
    DataSourceBase.Out
    DataSourceBase.Item[String]
    DataSourceBase.GetStream(String, String, Boolean, Boolean)
    DataSourceBase.List
    DataSourceBase.Attach(IDataSource)
    DataSourceBase.Attach(String, IDataSource, String)
    DataSourceBase.Attach(String, IDataStream)
    DataSourceBase.ProvideOut(Func<IEnumerable<IEntity>>, String)
    DataSourceBase.ProvideOut(Func<IImmutableList<IEntity>>, String)
    Namespace: ToSic.Eav.DataSources
    Assembly: ToSic.Eav.DataSources.dll
    Syntax
    [PublicApi_Stable_ForUseInYourCode]
    [VisualQuery(NiceName = "CSV Data", UiHint = "Load data from a CSV file", Icon = "description", Type = DataSourceType.Source, NameId = "ToSic.Eav.DataSources.CsvDataSource, ToSic.Eav.DataSources", DynamicOut = false, ConfigurationType = "|Config ToSic.Eav.DataSources.CsvDataSource", HelpLink = "https://r.2sxc.org/DsCsv")]
    public class CsvDataSource : CustomDataSourceAdvanced, IDataSource, IDataSourceSource, IAppIdentity, IZoneIdentity, IAppIdentityLight, ICacheInfo, ICacheKey, ICacheExpiring, ITimestamped, ICanPurgeListCache, IHasLog, IDataSourceTarget, IDataTarget, IDataSourceShared, IAppIdentitySync, IDataSourceLinkable

    Properties

    | Improve this Doc View Source

    ContentType

    Name of the content type which the imported entities have. This is fake, but may be necessary for later filtering of the types. Defaults to "CSV"

    Declaration
    [Configuration(Fallback = "CSV")]
    public string ContentType { get; set; }
    Property Value
    Type Description
    System.String
    Remarks
    • Before v15.03 it defaulted to "Anonymous"
    | Improve this Doc View Source

    Delimiter

    Delimiter character in the CSV, usually a ',' or ';' but could also be a tab or something. Default is tab.

    Declaration
    [Configuration(Fallback = "\t")]
    public string Delimiter { get; set; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    FilePath

    Path to the CSV file, relative to the website root

    Declaration
    [Configuration]
    public string FilePath { get; set; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    IdColumnName

    Column in the CSV which contains the ID.

    Declaration
    [Configuration]
    public string IdColumnName { get; set; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    TitleColumnName

    The CSV column containing the title of the item - for dropdowns etc. and the EntityTitle property.

    Declaration
    [Configuration]
    public string TitleColumnName { get; set; }
    Property Value
    Type Description
    System.String

    Implements

    IDataSource
    IDataSourceSource
    IAppIdentity
    IZoneIdentity
    IAppIdentityLight
    ICacheKey
    ICacheExpiring
    ITimestamped
    IHasLog
    IDataSourceTarget
    IDataSourceShared
    IDataSourceLinkable
    • Improve this Doc
    • View Source
    Back to top Generated by DocFX