मेरे आवेदन में मैं इकाई फ्रेमवर्क का उपयोग कर रहा हूं।लिंक से EntityFramework डेटटाइम
मेरे टेबल
-Article
-period
-startDate
मैं रिकॉर्ड से मेल खाने वाले की जरूरत है =>DateTime.Now > startDate and (startDate + period) > DateTime.Now
मैं इस कोड लेकिन इसकी अब काम करने की कोशिश की
Context.Article
.Where(p => p.StartDate < DateTime.Now)
.Where(p => p.StartDate.AddDays(p.Period) > DateTime.Now)
जब मैं अपने कोड को चलाने के निम्न अपवाद होते हैं
LINQ to Entities does not recognize the method 'System.DateTime AddDays(Double)' method, and this method cannot be translated into a store expression.
किस प्रकार 'period' है? 'AddDays' गलत कार्य है यदि यह' डबल' है। –
अवधि का प्रकार int – Yucel