Entity Framework : Exception using OrderBy() in Dynamic LINQ

Using OrderBy(“ColumnName”)

Exception : ‘ColumnName’ could not be resolved in the current scope or context. Make sure that all referenced variables are in scope, that required schemas are loaded, and that namespaces are referenced correctly., near simple identifier!

The solution : Always, should not miss “it” to prefix there in all the Dynamic LINQ. Hence, OrderBy(“it.ColumnName”)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: