public static DataEntity AddParent(this DataEntity source, IRelationshipDefinition rel, DataEntity parent) { ValidateParentRelationship(source, parent, rel); var relationshipName = rel.FullName; return(source.AddParent(relationshipName, parent)); }
/// <summary> /// Adds a parent to a DataEntity. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="source"></param> /// <param name="relationshipName"></param> /// <param name="parent"></param> /// <param name="converter"></param> /// <returns></returns> public static DataEntity AddParent <T>(this DataEntity source, string relationshipName, T parent, Func <T, DataEntity> converter) { var convertedParent = converter(parent); return(source.AddParent(relationshipName, convertedParent)); }
public static DataEntity AddParent <T>(this DataEntity source, IRelationshipDefinition rel, T parent, Func <T, DataEntity> converter) { var converted = converter(parent); return(source.AddParent(rel, converted)); }