Follow the code:
var fullEntries = dbContext.tbl_EntryPoint
.Join(
dbContext.tbl_Title,
combinedEntry => combinedEntry.entry.TID,
title => title.TID,
(combinedEntry, title) => new
{
UID = combinedEntry.entry.OwnerUID,
TID = combinedEntry.entry.TID,
EID = combinedEntry.entryPoint.EID,
Title = title.Title,
DeadLine= combinedEntry.Date.ToShortDateString() // Aqui está o problema
})
.Where(fullEntry => fullEntry.UID == user.UID).ToList();
How can I convert datetime to date string?
I get the following error:
Additional information: LINQ to Entities does not recognize the method 'System.String ToShortDateString()' method, and this method cannot be translated into a store expression.
So I took ToShortDateString()
, however I get that way in the view:
/Date(1491793200000)/
Any solution?