I am using the Dynamic Linq Library ( this ) in my .NET MVC application to query a SQL Server database. So far, everything is working fine.
However, the Linq dynamic library gives the "Expression expected" error when I use square brackets to indicate problematic column names containing spaces or hyphens. Here are some examples:
var query = context.FetchIceCream().AsQueryable().Where("Chocolate = 1"); // This is fine var query = context.FetchIceCream().AsQueryable().Where("[Rum and Raisin] = 1"); // This results in an "Expression expected" error
I cannot rename column names, so this is not an option - I need to be able to sort this in code. I searched high and low to solve this, but to no avail ... please help keep my sanity!
Chris source share