EF获取当天的数据集合

 var all = db.Content.Where(c => c.UserId == userId && DbFunctions.DiffDays(c.CreateDate,toDate)==0).DefaultIfEmpty().Count();

主要是使用了:

DbFunctions.DiffDays
posted @ 2019-10-23 12:07  James·wang  阅读(1255)  评论(0编辑  收藏  举报