Table of Contents

Class EntityIdFilter

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 ItemIdFilter DataSource is part of the Standard EAV Data Sources. It will only return the items with the id specified.

Warning: You should always use it in combination with a Content-Type filter, as you want to be sure nobody can just crawl any entity you have in your system!

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:

You can also use multiple values:

Or URL-parameters:

Programming With The ItemIdFilter 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 ?

API Documentation

[PublicApi]
[VisualQuery(NiceName = "Item Id Filter", UiHint = "Find items based on one or more IDs", Icon = "fingerprint", Type = DataSourceType.Filter, NameId = "ToSic.Eav.DataSources.EntityIdFilter, ToSic.Eav.DataSources", DynamicOut = false, In = new string[] { "Default*" }, ConfigurationType = "|Config ToSic.Eav.DataSources.EntityIdFilter", HelpLink = "https://go.2sxc.org/DsIdFilter")]
public class EntityIdFilter : DataSourceBase, IDataSource, IAppIdentity, IZoneIdentity, IAppIdentityLight, ICacheKey, ICacheExpiring, ITimestamped, IHasLog, IDataSourceLinkable
Inheritance
object
ServiceBase
EntityIdFilter
Implements
Inherited Members

Remarks

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

Properties

EntityIds

A string containing one or more entity-ids. like "27" or "27,40,3063,30306"

[Configuration]
public string EntityIds { get; set; }

Property Value

string