I have to display date in MMM dd,YYYY
format.
var performancereviews = from pr in db.PerformanceReviews
.Include(a => a.ReviewedByEmployee)
select new PerformanceReviewsDTO
{
ReviewDate=pr.ReviewDate.ToString("MMM dd,yyyy"),
EmployeeName=pr.ReviewedByEmployee.Name,
JobTitle=pr.ReviewedByEmployee.JobTitle,
ReviewerComments=pr.CommentsByReviewer,
EmployeeComments=pr.CommentsByEmployee
};
Here is error message that i am getting
ExceptionMessage: LINQ to Entities does not recognize the method 'System.String ToString(System.String)' method, and this method cannot be translated into a store expression. ExceptionType: System.NotSupportedException
When i apply ToString
on pr.ReviewDate
I get errors.
Kindly guide me with proper solution how can I accomplish this. I know in normal C# coding there are several options available but in Linq how can we do it.