开发者

What do I need to reference here?

开发者 https://www.devze.com 2023-01-08 02:23 出处:网络
I write this piece of code with C# using ADO.NE开发者_运维技巧T Entity Framework. I found error in here

I write this piece of code with C# using ADO.NE开发者_运维技巧T 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


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.


The only difference I can see between your code and the example is that you have a small "c" in "courses".

0

精彩评论

暂无评论...
验证码 换一张
取 消