Tuesday, November 15, 2011

Error: Delegate System.Func <> does not take 1 arguments

If you get the error
Delegate 'System.Func<entityName,int,bool>' does not take 1 arguments
or
Cannot convert lambda expression to type 'string' because it is not a delegate type

then check the linq query and confirm that the "where" condition has == instead of = ..
var allProducts = from p in context.Products where p.productID == 1 select p;

I wasted a lot of time on this and would like to help anyone else who might have similar issues