gpt4 book ai didi

c# - 错误 : LINQ to Entities does not recognize the method 'Int32 ToInt32

转载 作者:行者123 更新时间:2023-11-30 18:24:57 25 4
gpt4 key购买 nike

<分区>

我想在 linq 查询中将字符串转换为 int 并得到以下错误

Error: LINQ to Entities does not recognize the method 'Int32 ToInt32

在数据库中归档的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();

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com