Why does the below LINQ to SQL statment throw an exception?
I have a function
bool TrimAndCompare(string s1, string s2)
{
return customer.CustomerID.Trim() == customerID.Trim()
}
...some other function i call the above function in my linq statement
var customers = from customer in _context.Customers
where
TrimAndCompare(customer.CustomerID, customerID)
select customer;
The above LINQ to SQL statment function throws an exception but the below doesn't Why??
var customers = from customer in _context.Customers
where
customer.CustomerID.Trim() == customerID.Trim()
select customer;
I get a 'System.NotSupportedException' where I try to access customers