private static EntityProperty CreateNavProperty(XElement element, XContainer document) { var relationship = element.Attribute("Relationship").Value; var association = document.Edm() .Descendants("AssociationSet") .Single(ae => ae.Attribute("Association").Value == relationship); return new EntityProperty( association.Attribute("Name").Value, EntityPropertyType.NavigationProperty); }