private ApiObject HandleTypeDuplication(Guid id, ApiObject apiObj, string key, IDictionary <Guid, string> linkedType) { var match = UniquenessHelper.FirstOrDefaultWithSameProperties(apiObj, existingObjects, key, newObjects, emptyDic); if (match != null) { if (!linkedType.ContainsKey(id)) { linkedType.Add(id, match.Type); } } else { apiObj.Type = UniquenessHelper.GetUniqueName(existingObjects, apiObj.Type, newObjects, emptyDic); } return(match); }
private ApiObject HandleNameDuplication(Guid id, ApiObject apiObj, string key, IDictionary <Guid, string> linkedType) { var match = UniquenessHelper.FirstOrDefaultWithSameProperties(apiObj, existingObjects, key, newObjects, emptyDic); if (match != null) { linkedType.Add(id, match.Type); } else { apiObj.Name = UniquenessHelper.GetUniqueName(existingObjects, apiObj.Name, newObjects, emptyDic); foreach (var prop in apiObj.Properties) { prop.ParentClassName = apiObj.Name; } } return(match); }