Пример #1
0
        public IActionResult Create(string name, int?parentId)
        {
            if (string.IsNullOrWhiteSpace(name))
            {
                return(BadRequest());
            }

            var folder = new File
            {
                Name     = name,
                ParentId = parentId,
                IsFolder = true
            };

            _filesService.AddFolder(folder);
            _filesService.SaveChanges();

            return(Ok());
        }