Hello,
I want to use filtering on virtual collection. I read post http://blogs.infragistics.com/forums/p/43501/240440.aspx#240440.
And have a some questions:
What if we using RIA services and want to do filtering on serverside entities of ObjectContext i.e.
var testData = ObjectContext.TestData.Where((Expression<Func<TestData, bool>>)condition.GetCurrentBLOCKED EXPRESSION;
Will it works?
And how can I send an Expression to RIA service server side ?
BR,
Alexey Lukyanov
Same question here. We am using WCF with linq to NHibernate. Thanks
Hello again!
Some clarifications:
i.e. TestObject has 2 fields: ID and Name.
Now we are using WCF RIA Services SP1, so we can use code below:
TestContext context = new TestContext ();var query = c.GetTestObjectsQuery(); query = query.Where(o => o.Name== "foo");context .Load(query);
But if I try to use
var entityQuery = context .GetTestObjectsQuery(); entityQuery.IncludeTotalCount = true;
//_items - is a VirtualCollection foreach (var filterCondition in _items.FilterConditions) { foreach (var condition in filterCondition.Conditions) { var filterExpression = (Expression<Func<TestObject, bool>>)conditionGetCurrent E x p r e s s i o n (); if (filterExpression != null) { entityQuery = entityQuery.Where(filterExpression); } } }
And if we have filter at field 'ID' with value 5, LoadOperation has following error:
lo.Error {System.ServiceModel.DomainServices.Client.DomainOperationException:
Load operation failed for query 'GetTestObjects'.
Wait for expression (Expression) (at index 5)} System.Exception
{System.ServiceModel.DomainServices.Client.DomainOperationException}
So, my question is:
Does infragistics' supports EntityQuery filtration?
Please, ask if you have any questions.
It would be great if you help me asap :)