Ejemplo n.º 1
0
        public async Task <Contract.Models.Folder> CreateFolder(CreateFolderDto createFolderDto)
        {
            ValidationHelper.ValidateAndThrow(createFolderDto);
            await CheckExistingUser(createFolderDto.UserId);

            var model = new Contract.Models.Folder
            {
                Id     = Guid.NewGuid().ToString(),
                Name   = createFolderDto.Name,
                UserId = createFolderDto.UserId
            };

            await InitializeFolder(model);


            return(await _folderWriteOperations.Create(model));
        }
Ejemplo n.º 2
0
        public async Task <Contract.Models.Folder> CreateFolder(CreateFolderDto createFolderDto)
        {
            ValidationHelper.ValidateAndThrow(createFolderDto);
            await CheckExistingUser(createFolderDto.UserId);

            var statuseIds = new List <string>();

            for (int i = 0; i < 4; i++)
            {
                statuseIds.Add(Guid.NewGuid().ToString());
            }
            var model = new Contract.Models.Folder
            {
                Id            = Guid.NewGuid().ToString(),
                Name          = createFolderDto.Name,
                UserId        = createFolderDto.UserId,
                StatusesOrder = statuseIds
            };

            await InitializeFolder(model);


            return(await _folderWriteOperations.Create(model));
        }