public void CloneInBackground(ContentFile newFile, string fileName, int eventId, Uri sourceUri) { Task <Uri> t = FileManager.CloneBlobAsync(fileName, eventId, sourceUri); t.ContinueWith((finishedTask) => { newFile.Url = finishedTask.Result; lock (_context) { _context.ContentFiles.Add(newFile); _context.SaveChanges(); } }); }