I need to do this :
context.Ads.Where(c => c.PublishedDate.HasValue &&
c.EndDate.HasValue &&
c.EndDate.Value.AddTicks(c.PublishedDate.Value.Ticks) > currentTime &&
c.AdStatusMail.Where(b => b.StatusKey != (int)AdStatusMailKey.EndedRemainder && b.StatusKey != (int)AdStatusMailKey.MiddleRemainder).Count() < 1)
.ToList();
The problem is that AddTicks can´t be used in Linq. I have looked at the EntityFunctions but can´t see how to use it to do what I need?
IQueryable can’t handle the ticks, make it IEnumerable (or tolist). Here is an example: