markrendle / Simple.Data

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

Passing a non-SimpleExpression parameter to Having should throw an ArgumentException #287

Closed hmobius closed 11 years ago

hmobius commented 11 years ago

If I add a call to Having but pass it a parameter that is not a SimpleExpression - an integer string, etc (see below), Simple.Data throws a RuntimeBinderException.

db.Albums.All()
   .Select(db.Albums.Artists.Name, 
           db.Albums.AlbumId.Count().As("NumberOfAlbums"))
   .Having(123);

It should throw an ArgumentException.