-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Conversation
formatters, | ||
ContentTypes); | ||
} | ||
|
||
var incomingAcceptHeaderMediaTypes = formatterContext.ActionContext.HttpContext.Request.GetTypedHeaders().Accept ?? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the implication/purpose of this change? seems unrelated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes - It's unrelated, but not worth a separate PR. It was super unclear what happens when there is a single content, and lots of extra code was being executed. Since this is a scenario in this PR, I moved it up. Not extra tests needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the code now I see why you did the change. 👍 to clarity
updated |
/// <inheritdoc /> | ||
public async Task WriteAsync([NotNull] OutputFormatterContext context) | ||
{ | ||
using (var valueAsStream = ((Stream)context.Object)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we make this a Func<Stream>
. This way we know we'll own the lifetime of the Stream and we wouldn't have to deal with streams being created but not disposed because the pipeline never got here..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you mean like a pushstreamcontent, but how would the usage be...like you mean we should have a streamresult or something which takes this func?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pranavkm is suggesting that if the method returns Func<Stream>
the formatter will identify it as well. We discussed it earlier, and this could be a nice enhancement (in a separate PR/issue).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Include Functional tests and unit tests Resolves #1653
0f6d407
to
31f1cbb
Compare
|
Merged 5a3863d |
Include Functional tests and unit tests
Resolves #1653