You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider the following:
You want to get top X items which have an expand with at least one value matching condition Y.
For the expand you also only want to include items matching condition Y.
As far as I can tell, it's currently impossible to reuse the expressions from the filter on the expand with the Any condition on the root query level which means you would have to define that condition twice.
Simple example of how I imagine the call would look (using your test classes)
Expression<Func<string,bool>>isTestTag= t =>t=="testTag";varuri=_odataQueryBuilderDefault.For<ODataTypeEntity>(s =>s.ODataType).ByList().Expand(x =>x.For<string>(t =>t.Tags).Filter(isTestTag)).Filter((s,f,o)=>o.Any(s.Tags,isTestTag)).ToUri();uri.Should().Be("http://mock/odata/ODataType?$expand=Tags($filter='testTag')&$filter=Tags/any(t:t eq 'testTag')");
The text was updated successfully, but these errors were encountered:
…ny/all conditions on the root level.
Possible breaking:
Changed the All and Any methods to take Expression<Func<T, bool>> instead of Func<T, bool>.
As far as I can tell this does not impact anything since explicitly passing a non-null Func<T, bool> previously was unsupported.
fixesZEXSM#123
Consider the following:
You want to get top X items which have an expand with at least one value matching condition Y.
For the expand you also only want to include items matching condition Y.
As far as I can tell, it's currently impossible to reuse the expressions from the filter on the expand with the Any condition on the root query level which means you would have to define that condition twice.
Simple example of how I imagine the call would look (using your test classes)
The text was updated successfully, but these errors were encountered: