我正在尝试使用JOIN
执行简单的LINQ
,但会出现错误
the type of one of the expressions in the join clause is incorrect
CODE:
var select2 = from si in db.San_Imovel
join sic in db.San_Imovel_caracteristica <--- ERROR
on si.Imovel_Id equals sic.Imovel_Id
where si.Credenciada_Id == credenciada_Id
select new
{
si.Celula_Id,
si.Credenciada_Id,
si.Imovel_Id,
si.NomeArquivo,
si.TipoDsc1,
si.BairroDsc1,
si.AreaRealPrivativa,
si.ValorImovel,
si.ValorCondominio,
si.ValorIPTU,
si.Lat2,
si.Lon2,
si.Bairro1,
si.NomeCidade,
si.Transacao_ID
};
答案 0 :(得分:0)
如果您的媒体资源包含long
和int?
类型,那么您可以尝试此加入:
var select2 = from si in db.San_Imovel
join sic in db.San_Imovel_caracteristica
.Where(x => x.Imovel_Id.HasValue)
on si.Imovel_Id equals (long)sic.Imovel_Id.Value
where si.Credenciada_Id == credenciada_Id
select new { ... }