Add file results documentation for Minimal APIs and controllers#37257
Add file results documentation for Minimal APIs and controllers#37257mikekistler wants to merge 5 commits into
Conversation
|
Great content. I found a few minor items, with suggestions inline. For the build issue warning of missing code: |
There was a problem hiding this comment.
Approved, but review suggestions I made for some minor items inline and merge PR #312 first so the code will be found when this content builds again.
| <!-- Hope we can change this to IBinaryContent if #67145 is approved and implemented--> | ||
| The recommended `TResponse` for this case is `Stream`. The framework has special logic to map |
There was a problem hiding this comment.
Is this where it's handled?
Does that mean that FileContentHttpResult already works?
There was a problem hiding this comment.
I believe FileContentResult, FileContentHttpResult, StreamContentResult, and StreamContentHttpResult were all added in .NET 11 and not backported to .NET 10. So only 'IFormFile, Stream, and PipeReader` will work in .NET 10.
Co-authored-by: Wade Pickett <wpickett@microsoft.com>
Adds documentation for file result return values in ASP.NET Core, covering both Minimal APIs and controller-based APIs.
What's included
TypedResults.File/ControllerBase.File()with byte[] and StreamProduces<Stream>for binary,Produces<string>for textenableRangeProcessingfor partial content (206) responsesCode examples reference snippets in dotnet/AspNetCore.Docs.Samples (PR: dotnet/AspNetCore.Docs.Samples#312).
Internal previews