SingleOrDefault method:
results.Count() triggers a Count(*) query, then
single=results.ToList()[0]; triggers a SELECT.
This can be avoided by calling "ToList()" first, then checking if the List is empty. I have committed a patch but not sure if the Pull Request went through...
Also, the overload of SingleOrDefault with additional Provider details isn't calling OnLoaded, SetIsLoaded and SetIsNew.
SingleOrDefault method: results.Count() triggers a Count(*) query, then single=results.ToList()[0]; triggers a SELECT.
This can be avoided by calling "ToList()" first, then checking if the List is empty. I have committed a patch but not sure if the Pull Request went through...
Also, the overload of SingleOrDefault with additional Provider details isn't calling OnLoaded, SetIsLoaded and SetIsNew.
Cheers, GC