You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
First of all let me thank you for a fantastic library.
I recently was using the beta version of the library for a project and got stuck with the following issue.
I have noticed a small issue in ODataResponseMessage GetStreamAsync Method.
dotnetstandard 2 onwards HttpResponseMessage.Content directly supports the ReadAsStreamAsync method. Hence the typecast to StreamContent. The above typecase fails as the response.Content is of type NoWriteNoSeekStreamContent. So propose the following change
As is:
public Task GetStreamAsync()
{
var responseContent = _response.Content as StreamContent;
if (responseContent != null)
{
return responseContent.ReadAsStreamAsync();
}
else
{
var completionSource = new TaskCompletionSource();
completionSource.SetResult(Stream.Null);
return completionSource.Task;
}
}
To be:
public Task GetStreamAsync()
{
var responseContent = _response.Content;
if (responseContent != null)
{
return responseContent.ReadAsStreamAsync();
}
else
{
var completionSource = new TaskCompletionSource();
completionSource.SetResult(Stream.Null);
return completionSource.Task;
}
}
Do let me know your thoughts.
Thanks,
Neeraj
The text was updated successfully, but these errors were encountered:
Hi,
First of all let me thank you for a fantastic library.
I recently was using the beta version of the library for a project and got stuck with the following issue.
I have noticed a small issue in ODataResponseMessage GetStreamAsync Method.
dotnetstandard 2 onwards HttpResponseMessage.Content directly supports the ReadAsStreamAsync method. Hence the typecast to StreamContent. The above typecase fails as the response.Content is of type NoWriteNoSeekStreamContent. So propose the following change
As is:
To be:
Do let me know your thoughts.
Thanks,
Neeraj
The text was updated successfully, but these errors were encountered: