请就错误提出建议。这是代码
void Main()
{
var a = from id in TechnicalProducts
where id.Id == "ID-4591"
select new {
Country = id.Computers.Select (x => new {x.Location.ParentLocation.ParentLocation.ParentLocation.ParentLocation.Code}),
};
Console.WriteLine(a);
}
错误:导航属性“代码”返回的条目为空且无法初始化。您应该在访问此属性之前检查空值