5using System.Threading.Tasks;
7using Microsoft.AspNetCore.Mvc;
8using Microsoft.AspNetCore.Mvc.Infrastructure;
9using Microsoft.Extensions.DependencyInjection;
30 : base(MediaTypeNames.Application.Octet)
32 this.stream =
stream ??
throw new ArgumentNullException(nameof(
stream));
41 ArgumentNullException.ThrowIfNull(context);
43 var executor = context
47 return executor.ExecuteAsync(context,
this);
51 public ValueTask<Stream>
GetResult(CancellationToken cancellationToken) => ValueTask.FromResult(
stream);
Very similar to FileStreamResult except it's IActionResultExecutor<TResult> contains a fix for https:...
LimitedStreamResult(Stream stream)
Initializes a new instance of the LimitedStreamResult class.
override Task ExecuteResultAsync(ActionContext context)
ValueTask< Stream > GetResult(CancellationToken cancellationToken)
Gets the provided Stream. May be called multiple times, though cancelling any may cause all calls to ...
readonly Stream stream
The Stream result.
Interface for asynchronously consuming Streams of files.