Cannot implicitly convert type 'System.Linq.IQueryable<int>' to 'int?'
- by Aneef
Hi this is my code
var cityList = from country in doc.Element("result").Element("cities").Descendants("city")
select new
{
Name = country.Element("name").Value,
Code = country.Element("code").Value,
CountryCode = int.Parse(country.Element("countrycode").Value)
};
foreach(var citee in cityList)
{
City city = new City();
city.CountryID = from cnt in db.Countries where cnt.DOTWInternalID == citee.CountryCode select cnt.ID;
}
Im getting an error on the second query as the title of this post, i tried converting to int, to nullable int nothing worked? help me guys
Thanks,