private IRelationEndPointDefinition GetEndPointDefinition(ClassDefinition classDefinition, IPropertyInformation propertyInfo) { var endPointDefinition = classDefinition.GetRelationEndPointDefinition(NameResolver.GetPropertyName(propertyInfo)); if (endPointDefinition != null) { return(endPointDefinition); } return(new PropertyNotFoundRelationEndPointDefinition(classDefinition, propertyInfo.Name)); }
private string GetRelationID(IRelationEndPointDefinition first, IRelationEndPointDefinition second) { bool isFirstEndPointReal = !first.IsVirtual && !first.IsAnonymous; var endPoints = isFirstEndPointReal ? new { Left = first, Right = second } : new { Left = second, Right = first }; var leftPropertyName = NameResolver.GetPropertyName(endPoints.Left.PropertyInfo); if (endPoints.Right.IsAnonymous) { return(string.Format("{0}:{1}", endPoints.Left.ClassDefinition.ClassType.FullName, leftPropertyName)); } else { var rightPropertyName = NameResolver.GetPropertyName(endPoints.Right.PropertyInfo); return(string.Format("{0}:{1}->{2}", endPoints.Left.ClassDefinition.ClassType.FullName, leftPropertyName, rightPropertyName)); } }