private static Schema.AssociationEnd CreateAssociationEnd(string className, PropertyDeclaration property, List<ResourceType> entityResources) { if (!property.IsReferenceType()) { SchemaLoader.ThrowPropertyMetadataException(className, property.Name, Resources.AssociationEndType); } if (property.DataType.Type == DataTypeType.ObjectReferenceArray) { SchemaLoader.ThrowPropertyMetadataException(className, property.Name, Resources.NeedSingularReference); } ResourceType referencedResourceType = SchemaLoader.GetReferencedResourceType(property, className, entityResources); return new Schema.AssociationEnd(property.Name, referencedResourceType); }