var all = db.Content.Where(c => c.UserId == userId && DbFunctions.DiffDays(c.CreateDate,toDate)==0).DefaultIfEmpty().Count();
主要是使用了:spa
DbFunctions.DiffDays