排名
                
                
                    6
                
            
                    文章
                
                
                    6
                
            
                    粉丝
                
                
                    16
                
            
                    评论
                
                
                    8
                
            
            {{item.articleTitle}}
            
    {{item.blogName}} : {{item.content}}
        
            ICP备案  :渝ICP备18016597号-1
        
        
            网站信息:2018-2025TNBLOG.NET
        
        
            技术交流:群号656732739
        
        
            联系我们:contact@tnblog.net
        
        
            公网安备: 50010702506256
50010702506256
        
     50010702506256
50010702506256
         
        
            欢迎加群交流技术
        
     分类:
    .net
    
    分类:
    .net 
code:
var all = db.Content.Where(c => c.UserId == userId && DbFunctions.DiffDays(c.CreateTime,nowDate)==0).Count();
如果是查询当前的而不是一个时间范围其实查询大于当天的即可
DateTime nowDate = DateTime.Now.Date; return context.Article.Where(a => a.UserId == userId && a.CreateDate > nowDate).Count();
这算是一个比较好的小技巧不需要一个时间范围了
评价
     
         
         
        