LINQ to Entities does not recognize the method 'Int32 Parse(System.String)' method when attempting to parse a column for inequality comparisons

后端 未结 7 1105
抹茶落季
抹茶落季 2020-12-09 15:55

I have following code in my page:

var myVar= Entity.SetName
                 .Where(p => int.Parse(p.ID) >= start &&
                  int.Pars         


        
7条回答
  •  一向
    一向 (楼主)
    2020-12-09 16:20

    Although it's not efficient, you should be able to load all rows, and then use LINQ to Objects:

    var myVar= Entity.SetName.ToList()
                     .Where(p => int.Parse(p.ID) >= start &&
                      int.Parse(p.ID) <= end);
    

提交回复
热议问题