public async Task Preview(string id) { byte[] preview = previewService.GetCached(id); if (preview == null) { AVideoEntity video = await videoService.FindAsync(id); preview = await previewService.GetAsync(video); } using (Stream stream = this.Response.BodyWriter.AsStream()) { await stream.WriteAsync(preview, 0, preview.Length); } }