views:

137

answers:

1

I get a notsupportedexception when i run the following linq query. Any ideas how to resove it

        var declines = from d in _Db.DeclinedSettlementSet
                       where d.STATUS == Status.REPORTED               
                        && d.ADD_DATE < d.EDIT_DATE.AddDays(-3)
+1  A: 

from SP1 Microsoft has removed for client side function support from expression trees, this has been done to improve peroformance. in simple worlds any client side function can't be included in like in your case its .AddDays(n). regarding Jon's answer i think it won't work either as still TimeSpan is also a client side function.

Usman Masood
This is what I was thinking, but couldn't express in my now deleted answer.
jfar
So is there any suggestion on how to achieve the same result not using the adddays extension method?
skiik
frankly at this point of time i don't have any thing good in mind.. but the options i have in mind right now are two:Ist get all the records by initial filterationcontext.DeclinedSettlementSet.Where(k => k.Status==Status.REPORTED then perform business logic to filter it.or use sotre procedure to retrieve the records.i admit they are not very good options for such simple work...
Usman Masood