Class Serialization
- Namespace
- ToSic.Eav.DataSources
- Assembly
- ToSic.Eav.DataSources.dll
The base class for all DataSources, especially custom DataSources. It must always be inherited. It provides a lot of core functionality to get configurations, ensure caching and more.
Important: in most cases you will inherit the CustomDataSource DataSource for custom data sources.
[PublicApi]
[VisualQuery(NiceName = "Serialization Configuration", UiHint = "Determine how this data is Serialized", Icon = "settings_ethernet", Type = DataSourceType.Modify, NameId = "2952e680-4aaa-4a12-adf7-325cb2854358", DynamicOut = true, In = new string[] { "Default" }, ConfigurationType = "5c84cd3f-f853-40b3-81cf-dee6a07dc411", HelpLink = "https://go.2sxc.org/DsSerializationConfiguration")]
public class Serialization : DataSourceBase, IDataSource, IAppIdentity, IZoneIdentity, IAppIdentityLight, ICacheKey, ICacheExpiring, ITimestamped, IHasLog, IDataSourceLinkable
- Inheritance
-
Serialization
- Implements
- Inherited Members
Remarks
Had a major, breaking update in v15. Consult the guide to upgrade your custom data sources.
Properties
DropFalseValues
todo
[Configuration(Field = "RemoveFalseValues")]
public string DropFalseValues { get; }
Property Value
IncludeAppId
Should the AppId be included in serialization. Especially for scenarios where data is retrieved from multiple Apps
[Configuration]
public string IncludeAppId { get; }
Property Value
IncludeCreated
Should the Created date be included in serialization
[Configuration]
public string IncludeCreated { get; }
Property Value
IncludeGuid
Should the GUID be included in serialization
[Configuration]
public string IncludeGuid { get; }
Property Value
IncludeId
Should the ID be included in serialization
[Configuration]
public string IncludeId { get; }
Property Value
IncludeMetadata
Should the Metadata ID be included in serialization
[Configuration]
public string IncludeMetadata { get; }
Property Value
IncludeMetadataFor
Should the Metadata target/for information be included in serialization
[Configuration]
public string IncludeMetadataFor { get; }
Property Value
IncludeMetadataForId
Should the Metadata target/for information be included in serialization
[Configuration]
public string IncludeMetadataForId { get; }
Property Value
IncludeMetadataForType
Should the Metadata target/for information be included in serialization
[Configuration]
public string IncludeMetadataForType { get; }
Property Value
IncludeMetadataGuid
Should the Metadata GUID be included in serialization
[Configuration]
public string IncludeMetadataGuid { get; }
Property Value
IncludeMetadataId
Should the Metadata ID be included in serialization
[Configuration]
public string IncludeMetadataId { get; }
Property Value
IncludeMetadataTitle
Should the default Title of the Metadata be included as "Title" in serialization
[Configuration]
public string IncludeMetadataTitle { get; }
Property Value
IncludeModified
Should the Modified date be included in serialization
[Configuration]
public string IncludeModified { get; }
Property Value
IncludeRelationshipGuid
Should the Relationship GUID be included in serialization
[Configuration]
public string IncludeRelationshipGuid { get; }
Property Value
IncludeRelationshipId
Should the Relationship ID be included in serialization
[Configuration]
public string IncludeRelationshipId { get; }
Property Value
IncludeRelationshipTitle
Should the default Title of the Relationship be included as "Title" in serialization
[Configuration]
public string IncludeRelationshipTitle { get; }
Property Value
IncludeRelationships
Should the Relationships be included in serialization
[Configuration]
public string IncludeRelationships { get; }
Property Value
IncludeRelationshipsAsCsv
Should the Relationships be included as CSV like "42,27,999". Possible values
- null or false: they are sub-objects
- true or "csv": they are CSV strings
- "array" return array of ID or GUID
[Configuration(Fallback = false)]
public string IncludeRelationshipsAsCsv { get; }
Property Value
Remarks
- adding in v15.03
- extended purpose in v18.00 to also have "array" as possible value
IncludeTitle
Should the default Title be included as "Title" in serialization
[Configuration]
public string IncludeTitle { get; }
Property Value
IncludeTypeAs
Values probably
- empty (default) - don't include
- "object" make an object
- "flat"
[Configuration]
public string IncludeTypeAs { get; }
Property Value
IncludeTypeId
[Configuration]
public string IncludeTypeId { get; }
Property Value
IncludeTypeName
[Configuration]
public string IncludeTypeName { get; }
Property Value
IncludeZoneId
Should the AppId be included in serialization. Especially for scenarios where data is retrieved from multiple Apps
[Configuration]
public string IncludeZoneId { get; }
Property Value
Out
Gets the Dictionary of Out-Streams. This is the internal accessor, as usually you'll use this["name"] instead.
In rare cases you need the Out, for example to list the stream names in the data source.
public override IReadOnlyDictionary<string, IDataStream> Out { get; }
Property Value
- IReadOnlyDictionary<string, IDataStream>
A dictionary of named IDataStream objects, case insensitive
RemoveEmptyStrings
todo
[Configuration(Field = "RemoveEmptyStringValues")]
public string RemoveEmptyStrings { get; }
Property Value
RemoveNullValues
todo
[Configuration]
public string RemoveNullValues { get; }
Property Value
RemoveZeroValues
todo
[Configuration]
public string RemoveZeroValues { get; }
Property Value
TypePropertyNames
[Configuration(Fallback = "Type")]
public string TypePropertyNames { get; }