Dynamic LINQ Cast issue
问题 When I try to execute this ESQL (Cast int to string) with dynamic linq (from this link) queryable.Where("CAST(PositionID AS Edm.String).Contains(@0)", paramsObj); //PositionID is Int32 it throw exception ')' or ',' expected My Entity Framework version is 4.0. Any idea how to resolve this problem ? Thanks in advance, Brian 回答1: you cann't use as inside function call, try change your code like this queryable.Where("(PositionID.ToString().Contains(@0))", paramsObj); //PositionID is Int32 UPDATE: