markrendle / Simple.Data

A light-weight, dynamic data access component for C# 4.0
MIT License
1.33k stars 303 forks source link

OrderBy throws NullReferenceException instead of ArgumentException #270

Closed hmobius closed 11 years ago

hmobius commented 11 years ago

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