I'm trying to inject a dynamic where clause in my Linq to SQL query and I get an overload exception. The same expression work when added in the query proper?
qry.Where(Function(c) c.CallDate < Date.Now.AddDays(-1))
Any thoughts on how to this to work?
The exception reads:
Overload resolution failed because no accessible 'Where' can be called with these arguments:
Extension method 'Public Function Where(predicate As System.Func(Of Calls, Integer, Boolean)) As System.Collections.Generic.IEnumerable(Of Calls)' defined in 'System.Linq.Enumerable': Nested function does not have the same signature as delegate 'System.Func(Of Calls, Integer, Boolean)'.
Extension method 'Public Function Where(predicate As System.Func(Of Calls, Boolean)) As System.Collections.Generic.IEnumerable(Of Calls)' defined in 'System.Linq.Enumerable': Option Strict On disallows implicit conversions from 'Boolean?' to 'Boolean'.
Extension method 'Public Function Where(predicate As System.Linq.Expressions.Expression(Of System.Func(Of Calls, Integer, Boolean))) As System.Linq.IQueryable(Of Calls)' defined in 'System.Linq.Queryable': Nested function does not have the same signature as delegate 'System.Func(Of Calls, Integer, Boolean)'.
Extension method 'Public Function Where(predicate As System.Linq.Expressions.Expression(Of System.Func(Of Calls, Boolean))) As System.Linq.IQueryable(Of Calls)' defined in 'System.Linq.Queryable': Option Strict On disallows implicit conversions from 'Boolean?' to 'Boolean'. C:\Projects\Test Projects\Encore\EncoreData.vb 59 9 Encore
Thanks