private string EnsureUniqueNodeName(string nodeName, int id = 0)
        {
            var names = Database.Fetch <SimilarNodeName>("SELECT id, text AS name FROM umbracoNode WHERE nodeObjectType=@objectType",
                                                         new { objectType = NodeObjectTypeId });

            return(SimilarNodeName.GetUniqueName(names, id, nodeName));
        }
Esempio n. 2
0
        private string EnsureUniqueNodeName(int parentId, string nodeName, int id = 0)
        {
            if (EnsureUniqueNaming == false)
            {
                return(nodeName);
            }

            var names = Database.Fetch <SimilarNodeName>("SELECT id, text AS name FROM umbracoNode WHERE nodeObjectType=@objectType AND parentId=@parentId",
                                                         new { objectType = NodeObjectTypeId, parentId });

            return(SimilarNodeName.GetUniqueName(names, id, nodeName));
        }