Can a System.Web.Http endpoint be an IObservable? Can it be done while still using Attributes such as Route and AcceptVerbs?
Basically, I want to make the following code example into an IObservable stream so I'm subscribing and handling it via reactive extensions:
[Route("{id}")]
[AcceptVerbs("GET")]
public async Task<IHttpActionResult> example(int id)
{
return Ok(await Service.GetExampleAsync(id));
}
Edit: I'm looking for a more elegant solution like https://blogs.msdn.microsoft.com/jeffva/2010/09/15/rx-on-the-server-part-5-of-n-observable-asp-net (Observable from IHttpHandler) but hopefully more mature after seven years?