SenseNet.ContentRepository.Tools.CreateContent C# (CSharp) Метод

CreateContent() приватный статический Метод

private static CreateContent ( string parentPath, string name, string typeName ) : Content
parentPath string
name string
typeName string
Результат Content
        private static Content CreateContent(string parentPath, string name, string typeName)
        {
            if (string.IsNullOrEmpty(name))
                throw new ArgumentNullException("name");
            if (string.IsNullOrEmpty(typeName))
                throw new ArgumentNullException("typeName");

            var parent = Node.LoadNode(parentPath);

            if (parent == null)
                throw new ApplicationException("Parent does not exist: " + parentPath);

            //don't use admin account here, that should be 
            //done in the calling 'client' code if needed
            var content = Content.CreateNew(typeName, parent, name);
            content.Save();
            
            return content;
        }