public int AddFolder(string folderName, int?parentFolderId, int userId)
        {
            if (parentFolderId != null && _repository.GetFolder(parentFolderId.Value) == null)
            {
                throw new ContentNotExistError();
            }

            var guid = Guid.NewGuid().ToString();

            Folder folder = new Folder()
            {
                Name     = folderName,
                Guid     = guid,
                FolderId = parentFolderId,
                UserId   = userId,
            };

            int folderId = _repository.AddFolder(folder);

            return(folderId);
        }