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

Already on GitHub? Sign in to your account

OrderBy throws NullReferenceException instead of ArgumentException #270

Closed
hmobius opened this Issue Mar 28, 2013 · 0 comments

Comments

Projects
None yet
1 participant

hmobius commented Mar 28, 2013

If I call OrderBy(xyz) where xyz is anything other than a column reference, I'd expect an ArgumentException to be thrown. However a NullReferenceException is thrown instead when there is one. For instance

// Throws NullReferenceException
db.Albums.All().OrderBy(1); 
db.Albums.All().OrderBy(db.Albums.GenreId == 1));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment