markrendle / Simple.Data

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

Calling Where with wrong number of arguments should throw ArgumentException #322

Open hmobius opened 10 years ago

hmobius commented 10 years ago

Where() takes one SimpleExpression argument. If I call Where() with zero or more than one argument, it throws a BadExpressionException. For example

var throwZero = db.Albums.All().Where();

var throwTooMany = db.Albums.All()
   .Where(db.Albums.GenreId == 1, db.Albums.ArtistId == 120);

In both cases, Simple.Data should throw an ArgumentException.