这个在项目中用到了,在网上找了一下才找到,留下来以后自已使用。

List<UniversalInfo> list =new List<UniversalInfo>();
            list = (from n in dbEntities.UniversalInfo
                where n.UniTypeId == unitypeid && n.IsFlag == 1
                orderby n.CreateTime descending
                select new
                {
                    UniInfoId = n.UniTypeId,
                  
                    UniInfoTitle = n.UniInfoTitle,
                  
                    CreateTime = n.CreateTime
                }).ToList().Select(a=>new UniversalInfo
                {
                    UniTypeId = a.UniInfoId,
                    UniInfoTitle = a.UniInfoTitle,
                    CreateTime = a.CreateTime
                }).ToList();
            return list;
View Code

相关文章:

  • 2022-12-23
  • 2022-01-16
  • 2021-05-16
  • 2022-12-23
  • 2022-02-22
  • 2021-10-17
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-28
  • 2022-12-23
  • 2021-05-28
  • 2022-12-23
相关资源
相似解决方案