public static string Import <T>(string portalId, Models.CommentContainer container, Dictionary <string, string> idMap, string userId = null) { userId = string.IsNullOrEmpty(userId) ? Account.AuditId : userId; var existing = Get(container.ContainerType, container.ContainerId, portalId); if (existing != null) { container.Id = existing.Id; } else { container.Id = null; } container.PortalId = portalId; container.ContainerId = Portal.GetIdMap <T>(container.ContainerId, idMap); return(Save(container, userId)); }
public static List <string> GetNewRoleIds(List <string> roleIds, Dictionary <string, string> map) { var newRoleIds = new List <string>(); if (roleIds != null) { foreach (var roleId in roleIds) { var newRoleId = Portal.GetIdMap <Models.Role>(roleId, map); if (!string.IsNullOrEmpty(newRoleId)) { newRoleIds.Add(newRoleId); } } } return(newRoleIds); }