小编use*_*838的帖子

LINQ OrderBy不订购..一无所获..为什么?

知道为什么LINQ OrderBy不能在下面的代码中工作,(没有错误,但方法不排序......)

首先是我自己的类型

public class IQLinksView
    {
        public int id { get; set; }
        public int catid { get; set; }
        public int? viewed {get;set;}
        public string name {get;set;}
        public string desc {get;set;}
        public string url {get;set;}
        public string pic {get;set;}
        public string cat {get;set;}
    }
Run Code Online (Sandbox Code Playgroud)

然后查询:

IQueryable<IQLinksView> newView = 
              from links in this.emContext.tbl_otherlinks
              select new IQLinksView { id = links.pklinkid, catid =
              links.tbl_catgeory.pkcategoryid, viewed = links.linkviewed, name = links.linkname, 
              desc = links.linkdesc, pic = links.linkpicture,   url = links.linkurl, cat …
Run Code Online (Sandbox Code Playgroud)

linq entity-framework iqueryable sql-order-by

20
推荐指数
1
解决办法
1万
查看次数

标签 统计

entity-framework ×1

iqueryable ×1

linq ×1

sql-order-by ×1