public void UploadChunk(FileChunk chunk) { using (MemoryStream stream = new MemoryStream(chunk.ChunkData)) { _blobRepository.UploadBlock(chunk.FileId, chunk.ChunkId, stream); SmallChunk smallChunk = new SmallChunk() { ChunkId = chunk.ChunkId, OriginalChunkId = chunk.OriginalChunkId }; _azureCache.PutItem(new CacheItem() { FileId = chunk.FileId, Item = smallChunk }); } }