SenseNet.ContentRepository.ContentNamingHelper.EnsureContentName C# (CSharp) Метод

EnsureContentName() приватный Метод

private EnsureContentName ( string nameBase, Node container ) : string
nameBase string
container Node
Результат string
        public static string EnsureContentName(string nameBase, Node container)
        {
            if (string.IsNullOrEmpty(nameBase))
                return nameBase;

            if (container == null)
                throw new ApplicationException("Cannot create a new Content: expected context node is null");

            var index = 0;
            string newName = null;
            while (Node.Exists(GetNewPath(container, nameBase, index++, out newName)))
            {
            }

            return newName;
        }
        #endregion

Usage Example

Пример #1
0
 public static string EnsureContentName(string nameBase, Node container)
 {
     return(ContentNamingHelper.EnsureContentName(nameBase, container));
 }