How can I apply an OData function on a related property of a breeze entity query?
For example, I have two entities EntityA and EntityB
public class EnityA{
public ICollection<EntityB> Collection {get; set;}
}
public class EnityB{
public DateTime DateColumn {get; set;}
public EnityA One {get; set;}
}
I am able to create a breeze query on EntityB that uses OData functions. For example
var pred1 = Predicate.create('year(DateColumn)', '==', 2018)
var queryOnEntityB = EntityQuery.from('EntityB').where(pred1)
The query above works well. However, the query below DOES NOT work.
var pred1 = Predicate.create('year(DateColumn)', '==', 2018)
var pred2 = Predicate.create('Collection ', 'any', pred1)
var queryOnEntityA = EntityQuery.from('EntityA').where(pred2);
I get the error
Cannot find a property named "DateColumn" on type "EntityA"
Strangely, it tries to find the column on the wrong entity. However, the following query works:
var pred1 = Predicate.create('DateColumn', '==', '2018-02-02')
var pred2 = Predicate.create('Collection ', 'any', pred1)
var queryOnEntityA = EntityQuery.from('EntityA').where(pred2);
It therefore seems as the error only occurs when trying to include an OData function on the navigational property. Am I doing something wrong and how can this be corrected?