I\'ve a little question about performance with Entity Framework.
Something like
using (MyContext context = new MyContext())
{
Document DocObject
Your first query isnt fully transalted to sql - when you call .ToList().Count(), you are basically saying "download all, materialize it to POCO and call extension method named Count()" which, of course, take some time.
Your second query is, however, transalted to something like select count(*) from Documents where GroupId = @DocObjectGroup which is much faster to execute and you arent materializing anything, just simple scalar.