Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: GroupBy fails for field named SHORT #180

Closed
alexfestbaum opened this issue Jun 29, 2018 · 2 comments
Closed

Question: GroupBy fails for field named SHORT #180

alexfestbaum opened this issue Jun 29, 2018 · 2 comments

Comments

@alexfestbaum
Copy link

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.

@alexfestbaum
Copy link
Author

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();

@StefH
Copy link
Collaborator

StefH commented Jul 22, 2018

SHORT is probably a reserved keyword.

@StefH StefH closed this as completed Jul 22, 2018
@StefH StefH changed the title GroupBy fails for field named SHORT Question: GroupBy fails for field named SHORT Jul 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants