public static Employee RelatedObject(this EmployeeEntity entity, Hashtable seenObjects, Hashtable parents) { if (null == entity) { return(null); } if (seenObjects.Contains(entity)) { if (parents.Contains(entity)) { // avoid cyclic references return(null); } else { return(seenObjects[entity] as Employee); } } return(entity.ToDto(seenObjects, parents)); }
public static Employee ToDto(this EmployeeEntity entity) { return(entity.ToDto(new Hashtable(), new Hashtable())); }