markrendle / Simple.Data

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

Running With without a base command should throw NullReferenceException #282

Open hmobius opened 11 years ago

hmobius commented 11 years ago

If I use a With statement without a base query command (FindAllBy, Get etc), Simple.Data runs the command successfully as if All() had been included. For example

db.Albums.WithArtists();

is equivalent to

db.Albums.All().WithArtists();

Shouldn't this throw a NullReferenceException just as OrderBy does if there is no base command?