LastModifiedDate= db.Database.SqlQuery
new SqlParameter("@TimeCardID", timecard.TimeCardID),
new SqlParameter("@InvoiceSourceTypeID", 1)
).FirstOrDefault(),
This function is returning DateTime value which i am adding in entity frame work code ,
but when running the solution it gives error
["LINQ to Entities does not recognize the method "]
Please suggest
Tuhin PaulPosted Mar 7, 2023, 4:06 AM
Hello Basit,
The error message "LINQ to Entities does not recognize the method" occurs because Entity Framework cannot translate the "fnGetLastModifiedDate" function into SQL code.
One way to resolve this issue is to retrieve the data from the database first, and then use LINQ to manipulate the data in memory.
Naimish MakwanaPosted Mar 6, 2023, 5:09 PM
Hello Basit,
Please check below link it may helpful to you.
https://stackoverflow.com/a/22660119/3054222
Thanks
Naimish Makwana