我必须以MMM dd,YYYY格式显示日期.
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
};
Run Code Online (Sandbox Code Playgroud)
这是我得到的错误消息
ExceptionMessage:LINQ to Entities无法识别方法'System.String ToString(System.String)'方法,并且此方法无法转换为商店表达式.ExceptionType:System.NotSupportedException
当我申请时ToString,pr.ReviewDate我得到错误.
请指导我正确的解决方案如何实现这一目标.我知道在正常的C#编码中有几个选项可用,但在Linq我们怎么做呢.
我必须使用Web Essentials 2013但它不适用于Visual Studio 2013更新5.我必须安装VS 2013更新4才能安装Web Essentials 2013.有没有办法我可以安装VS 2013更新4卸载整个VS 2013更新5以节省时间.