I'm looking into building an adhoc datasource to provide some more insight into usage of our matrix crosspoints. since every crosspoint being made adds an information event i'm tempting to go through them with the repositoryRegistry however instead of fetching all information events on a wildcard and then filtering them i was wondering if i can already dynamicaly add them to an orfilter
Basically i want to add a bunch of
new ORFilterElement<Info>(
InfoExposers.ParameterName.Contains("search x" ),
InfoExposers.Value.Contains("Value x"),
InfoExposers.ElementID.Equal(elementId),
InfoExposers.SeverityID.Equal(severity)
);
into
var filter = new ANDFilterElement<Info>(
InfoExposers.TimeOfArrival.GreaterThan(start),
InfoExposers.TimeOfArrival.LessThan(end),
Dynamiclistof Filters
);
so i can pass them to the: CreateReadQuery(filter).Execute();
is this possible?
Hello Gerwin!
I haven't had such a use case myself, but I can confirm that code-wise this will compile as these classes are implemented from the same interface, IFilterElement
Here's a code snippet of some combinations you can try:
var orFilter1 = InfoExposers.AlarmID.Equal(7236128).OR(
InfoExposers.AlarmID.Equal(237473),
InfoExposers.AlarmID.Equal(95738));
var orFilter2 = InfoExposers.SeverityID.Equal(4).OR(
InfoExposers.SeverityID.Equal(0),
InfoExposers.SeverityID.Equal(5));
// Option 1: without inital filter
var filter1 = new ANDFilterElement<Info>(orFilter1, orFilter2);
// Option 2: with inital filter
var filter2 = InfoExposers.AlarmID.Equal(2).AND(orFilter1, orFilter2);
// Option 3: Mixed
var filter3 = new ANDFilterElement<Info>(InfoExposers.Comments.Contains("T").AND(orFilter1), orFilter2);