我正在尝试直接从 LINQ-to-Entities 查询表达式中获取格式化的日期字符串。
nonBusinessDays = (from ac in db.AdminCalendar
where ac.DateTimeValue >= calendarStartDate && ac.DateTimeValue <= calendarEndDate && ac.IsBusinessDay == false
select ac.MonthValue + "/" + ac.DayOfMonth + "/" + ac.FullYear).ToList();
但是,我收到以下错误消息:“无法将类型 'System.Nullable`1' 转换为类型 'System.Object'。LINQ to Entities 仅支持转换实体数据模型原始类型。”
除了遍历结果集之外,还有什么方法可以做到这一点?谢谢!安倍