markrendle / Simple.Data

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

Exists ignores all arguments when two or more are present. Should throw ArgumentException #317

Open hmobius opened 10 years ago

hmobius commented 10 years ago

Exists() can take zero or one SimpleExpressions as argument. However, when two SimpleExpressions, valid or invalid, are passed to it, Exists ignores them all and runs as if it had no argument at all. For example,

var testPlural = db.Albums.Exists(
  db.Albums.GenreId == 1, db.Albums.AlbumId == 1); 

In this case, I would expect an ArgumentException to be thrown. Instead, SimpleData checks for data in the Albums data and returns true.