LINQ to Entities with AddMonth method

后端 未结 4 807
渐次进展
渐次进展 2020-12-05 17:18

This is my code:

 return Newsletterctx.Subscribers.Count(o =>
     o.Validated == false &&
     o.ValidationEmailSent == true &&
     o.Su         


        
4条回答
  •  清歌不尽
    2020-12-05 18:04

    Perhaps you can shift the date to test against instead:

    DateTime testDate = DateTime.Now.AddMonths(-1);
    return Newsletterctx.Subscribers.Count
                (o => o.Validated == false 
                 && o.ValidationEmailSent == true 
                 && o.SubscriptionDateTime < testDate);
    

提交回复
热议问题