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

ThenBy should throw NullReferenceException if there is no base command #277

Open
hmobius opened this Issue Apr 10, 2013 · 0 comments

Comments

Projects
None yet
1 participant

hmobius commented Apr 10, 2013

If I call ThenBy() directly on a table reference without a base command (All, FindAll etc), I'd expect a NullReferenceException to be thrown because there's no command to qualify. However, if I call any of the following

db.Albums.ThenBy();
db.Albums.ThenByArtistId();
db.Albums.ThenBy(db.Albums.ArtistId);
db.Albums.ThenBy(db["Albums"]["ArtistId"]);

I get an InvalidOperationException because there's no OrderBy in the Command. For consistency, I think this should toe the same line as OrderBy and throw NullReferenceException.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment