可能重复:
Explicit construction of entity type '###' in query is not allowed
以下代码显示错误
var toDoSessionsInDB =
from todo in todoZession.ZSESSIONs
select new ZSESSION
{
ZTYPE = Convert.ToString(todo.ZENDTIME.TimeOfDay),
ZNAME = todo.ZNAME,
ZTRACK = todo.ZTRACK
};
ToDoZessions = new ObservableCollection<ZSESSION>(toDoSessionsInDB);
错误是...不允许在查询中显式构造实体类型“App.MainPage + ZSESSION”。 -