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

后端 未结 7 1124
抹茶落季
抹茶落季 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:32

    First try to convert to int then pass that variable name

    int catgry = Convert.ToInt32(customercategory.OWNERSHIP_TYPE);
    var customerCateg = (from d in _db.tbl_SIL_CUSTOMER_CATEGORY_MST
        .Where(d => d.CAT_ID == catgry) select d.CAT_TYPE).SingleOrDefault();
    

提交回复
热议问题