I have an EF entity object sysSettings class that has a few properties. group and name is among these properties.
quer in the code below is an IQueryable<sysSettings> object.
When trying to write the following query, I’m having difficulty with the second where clause.
var query = from setting in quer
where (setting.name.Equals("Url") && setting.group.Equals("system"))
select setting;
It seems that when I have a property on an Entity object called group I cannot access that property from within the LINQ query.
I think this might be because group may be a reserved/contextual work/action in LINQ.
Changing the property name of the Entity is unfortunately not an option.
Add
@symbol to your property name (only for query, do not change settings class definition):This symbol allows you to to use reserved word (which is
group).