Nella mia applicazione sto utilizzando Entity Framework.Linq to EntityFramework DateTime
mia tavola
-Article
-period
-startDate
Ho bisogno record che corrispondono =>DateTime.Now > startDate and (startDate + period) > DateTime.Now
ho provato questo codice, ma la sua ora lavorando
Context.Article
.Where(p => p.StartDate < DateTime.Now)
.Where(p => p.StartDate.AddDays(p.Period) > DateTime.Now)
Quando eseguo il mio codice la seguente eccezione si verificano
LINQ to Entities does not recognize the method 'System.DateTime AddDays(Double)' method, and this method cannot be translated into a store expression.
Che tipo è 'punto'? 'AddDays' è la funzione sbagliata se è un' double'. –
il tipo di periodi è int – Yucel