Nullable <Guid> GetParentId(string child) { string strParent = this.GetStringParent(child); if (!GuidMap.ContainsKey(strParent)) { Guid newGuid = Guid.NewGuid(); GuidMap.Add(strParent, newGuid); return(newGuid); } Nullable <Guid> nullGuid = null; return((!strParent.Equals("ROOT")) ? GuidMap[strParent] : nullGuid); }
/// <summary> /// Finds and returns a Guid from the mapping dictionary. If no mapping /// exists then the original Guid is returned. /// </summary> /// <param name="oldGuid">The original Guid value to map from.</param> /// <returns>The Guid value that should be used, may be the same as oldGuid.</returns> public Guid FindMappedGuid(Guid oldGuid) { return(GuidMap.ContainsKey(oldGuid) ? GuidMap[oldGuid] : oldGuid); }