-
Notifications
You must be signed in to change notification settings - Fork 190
Changed SaveAs[Async](string) to CopyTo[Async](Stream) #543
Conversation
0f05427
to
fc30ec7
Compare
var inputStream = OpenReadStream(); | ||
inputStream.CopyTo(fileStream, DefaultBufferSize); | ||
} | ||
OpenReadStream().CopyTo(target, DefaultBufferSize); |
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.
Shouldn't we be disposing our stream? If we don't who does?
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.
Yeah, I've seen it being disposed other places...
2b0ca42
to
777eb18
Compare
777eb18
to
7a5208a
Compare
@Tratcher Could you have a look? |
@lodejard @davidfowl What's the point of having IFormFile.CopyTo(Stream) when you already have IFormFile.OpenReadStream().CopyTo(Stream)? Should we just remove SaveAs(string)? |
Good point 😝👍 |
Hmm I guess it would actually be something like:
This might be worth it if it was actually important to dispose the readStream, but so far it isn't. |
Rebased and merged. |
#527