I'm trying to use the linq query, when I try to convert the height value somehow I'm getting error during runtime.
Error:
LINQ to Entities does not recognize the method 'Int32 ToInt32(System.String)' method, and this method cannot be translated into a store expression.
Is there a better way to compare the height value?
case "HeightFrom":
photosquery = photosquery.Where(x => Convert.ToInt32(x.physical.BodyHeight.TrimEnd()) >= Convert.ToInt32(height));
break;