public void SynchronizationFiles()
        {
            List <BlobItem> newBlobs = this.blobModel.SynchronizationBlobs();
            FolderItem      f;

            foreach (BlobItem b in newBlobs)
            {
                f = FolderBlobFactory.Create(b.FileId, rootFolder);
                _context.FolderItems.Add(f);
                _context.SaveChanges();
            }
        }
        public BlobItem CreateFolderBlobItem(ICreateBlob postData, int folderId)
        {
            BlobItem b = this.blobModel.CreateBlobItem(postData);

            if (b == null)
            {
                return(null);
            }

            FolderItem f = FolderBlobFactory.Create(b.FileId, folderId);

            _context.FolderItems.Add(f);
            _context.SaveChanges();
            return(b);
        }
        public BlobItem CopyFileToAnotherFolder(int blobId, int folderId)
        {
            BlobItem b = this.blobModel.GetSingleFile(blobId);

            if (b == null || !DoesFolderExist(folderId))
            {
                return(null);
            }
            BlobItem   copy = this.blobModel.CopyFile(b);
            FolderItem f    = FolderBlobFactory.Create(copy.FileId, folderId);

            _context.FolderItems.Add(f);
            _context.SaveChanges();
            return(copy);
        }