Question: GroupBy fails for field named SHORT
Issuing a GroupBy against a entity field named SHORT results in the following error:
'.' or '(' or string literal expected
var result = baseData
.Select(entityName)
.GroupBy("SHORT", "it")
.Select("new (it.Key as value, it.Count() as count)")
.ToDynamicList();
Short seems to be a protected key/word. How can I resolve this issue? Padding the field with '[SHORT]' like SQL Server would do did not help.
Adding the prefix it. helped to prevent the issue:
var result = baseData .Select(entityName) .GroupBy("it.SHORT", "it") .Select("new (it.Key as value, it.Count() as count)") .ToDynamicList();
SHORT is probably a reserved keyword.