这里我需要参考什么?
我使用 ADO.NET 实体框架用 C# 编写了这段代码。
我在这里发现错误
var departmentQuery = from d in schoolContext.Departments.Include("courses")
orderby d.Name // here
select d;
错误消息如下:
Cannot convert lambda expression to type 'string' because it is not a delegate type
我正在根据这篇文章
http://msdn.microsoft.com/en-us/library/bb386884.aspx
请指出我需要修改什么?
提前致谢!
此致, 红魔队
I write this piece of code with C# using ADO.NET Entity Framework.
I found error in here
var departmentQuery = from d in schoolContext.Departments.Include("courses")
orderby d.Name // here
select d;
Error message is like the following:
Cannot convert lambda expression to type 'string' because it is not a delegate type
I am doing according this articles
http://msdn.microsoft.com/en-us/library/bb386884.aspx
please point out what do i need to modify?
Thanks in advance!
Best regards,
RedsDevils
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
确保代码中有 using System.Linq 。如果您无法在您的智力中找到它,请在项目中添加对此的参考。
Make sure you have the using System.Linq in the code. Add a reference for this in project if you are unable to find it in your intellicence.
我可以看到你的代码和示例之间的唯一区别是你在“courses”中有一个小“c”。
The only difference I can see between your code and the example is that you have a small "c" in "courses".