Cannot implicitly convert type 'System.Linq.IQueryable' to 'int?'

前端 未结 6 1793
梦毁少年i
梦毁少年i 2021-02-06 23:14
var cityList = from country in 
                    doc.Element(\"result\")
                    .Element(\"cities\")
                    .Descendants(\"city\")
select ne         


        
6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-06 23:24

    it will return an iQueryable, you will need to do something like using the First

    cit.CountryID = db.Countries.First(a=>a.DOTWInternalID == citee.CountryCode).ID
    

提交回复
热议问题