Calling First() or FirstOrDefault() within a Select function should throw InvalidOperationException #292

Closed
hmobius opened this Issue May 8, 2013 · 2 comments

Comments

Projects
None yet
2 participants

hmobius commented May 8, 2013

If you call either of

var db = Database.Open().Albums.Select(db.Albums.First());
var db = Database.Open().Albums.Select(db.Albums.FirstOrDefault());

You get a NullReferenceException thrown back. If you call

var db = Database.Open().Albums.All().Select(db.Albums.First());
var db = Database.Open().Albums.All().Select(db.Albums.FirstOrDefault());

You get an InvalidOperationException thrown back. Suggest that both calls should throw an InvalidOperationException.

hmobius commented May 8, 2013

Applies also to Single() and SingleOrDefault()

Owner

markrendle commented May 21, 2013

Fixed.

markrendle closed this May 21, 2013

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