from c in Country
where c.IsActive.Equals(true)
orderby c.CountryName
select new
{
countryIDCode = c.CountryID + "|" + c.TwoDigitCode,
countryName = c.CountryName
}
但是当我运行它时,我收到以下错误:
无法将类型'System.Int32'转换为类型'System.Object'。LINQ to Entities仅支持将Entity Data Model基元类型强制转换。
CountryID是int
类型,而TwoDigitCode是string
类型。
如何正确地进行连接?