我想在linq查询中将字符串转换为int并获得跟随错误
错误:LINQ to Entities无法识别方法' Int32 ToInt32
在DataBase中,归档的arID是varchar
var AllArea = (from arr in dbcontext.Areas
join city in dbcontext.Cities on Convert.ToInt32(arr.arID) equals city.cityID
select new
{
arr.arID,
arr.AreaName,
city.cityID,
city.cityName
}).ToList();
答案 0 :(得分:0)
尝试使用此- (int)arr.arID
...