Calling First() or FirstOrDefault() with an invalid argument should throw ArgumentException #293

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

Comments

Projects
None yet
2 participants
@hmobius

hmobius commented May 8, 2013

If you call any of

var db = Database.Open.Albums.All().First(123);
var db = Database.Open.Albums.All().First<Album>(123);
var db = Database.Open.Albums.All().FirstOrDefault(123);
var db = Database.Open.Albums.All().FirstOrDefault<Album>(123);

A RuntimeBinderException is thrown. Suggest that an ArgumentException should be thrown in all four cases.

@hmobius

This comment has been minimized.

Show comment Hide comment
@hmobius

hmobius May 8, 2013

Applies also to Single() and SingleOrDefault()

hmobius commented May 8, 2013

Applies also to Single() and SingleOrDefault()

@markrendle

This comment has been minimized.

Show comment Hide comment
@markrendle

markrendle May 21, 2013

Owner

Now throws InvalidOperationException

Owner

markrendle commented May 21, 2013

Now throws InvalidOperationException

@markrendle markrendle closed this May 21, 2013

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