markrendle / Simple.Data

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

Calling Where without a base command throws wrong Exception #321

Open hmobius opened 10 years ago

hmobius commented 10 years ago

If I call Where without a query command - All, FindAllBy etc - Simple.Data throws a BadExpressionException.

var testOne =  db.Albums.Where(db.Albums.GenreId == 1);

Regardless of whether the SimpleExpression passed in to Where is valid or not, this should throw an InvalidOperationException shouldn't it?