Table of Contents

Class ItemFilterDuplicates

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.

The ItemFilterDuplicates DataSource is part of the Standard EAV Data Sources. It will provide two streams, one with all the items (but without the duplicates) and one with all the duplicates, in case you need these.

How to use with the VisualQuery

When using the VisualQuery you can just drag it into your query. This is what it usually looks like:

The above example shows two filters finding items and delivering them on the same stream.

Because 1 item would have been delivered 2x (2sic is in Switzerland), the default-stream now only contains each item once, and the duplicates can also be retrieved from the Duplicates stream if needed.

Example Using StreamMerge

A common scenario will also combine this using the StreamMerge. It's demonstrated there.

No Settings

The ItemFilterDuplicates DataSource has no settings to configure.

Note that it will automatically merge the streams in A-Z order of the In-Stream names.

Programming With The ItemFilterDuplicates DataSource

We recommend to use the VisualQuery where possible, as it's easier to understand and is identical for C# and JavaScript. It's also better because it separates data-retrieval from visualization.

Read also

You should find some examples in this demo App

History

  1. Introduced in EAV 4.x, 2sxc 9.10

API Documentation

[PublicApi]
[VisualQuery(NiceName = "Filter duplicates", UiHint = "Remove items which occur multiple times", Icon = "filter_1", Type = DataSourceType.Logic, NameId = "ToSic.Eav.DataSources.ItemFilterDuplicates, ToSic.Eav.DataSources", DynamicOut = false, In = new string[] { "Default" }, HelpLink = "https://go.2sxc.org/DsFilterDuplicates")]
public sealed class ItemFilterDuplicates : DataSourceBase, IDataSource, IAppIdentity, IZoneIdentity, IAppIdentityLight, ICacheKey, ICacheExpiring, ITimestamped, IHasLog, IDataSourceLinkable
Inheritance
ItemFilterDuplicates
Implements
Inherited Members

Remarks

Had a major, breaking update in v15. Consult the guide to upgrade your custom data sources.