DB.Customers.Count(c => c.City == "London"); Specified cast not valid exception, if there is some customers from London. However Func<Customer, bool> predicate = c => c.City == "London"; DB.Customers.Count(predicate); works well. Another bug(?): When I delete customer from database in one page request and then execute Customer cust = DB.Customers.SingleOrDefault(c => c.CustomerID == deletedCustomerID) ; in the other request, it somehow brings this customer from
Read More...