Sunday, 7 January 2018

c# - How we can return Task return type to HttpResponseMessage type?

Is there a way where we can return TaskHttpResponseMessage
type to HttpResponseMessage type?Below is the
code.



 private HttpResponseMessage
Process(string receiver,HttpRequestMessage request)
{
Reciever
test = new Reciever();
Task res=
test.ReceiveAsync(receiver, request);
return res;

}



Actually
my ReceiveAsync method is of
async type and i dont want
Process Method to be of async
type.



Any idea on
this?



Thanks!

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print ...