I'm still not clear when do you return a class and when a HttpResponseMessage like HttpStatusCode.OK on an WebAPI controller.
Is it when you don't expect nothing in return, that's when you return a HttpResponseMessage?
I'm still not clear when do you return a class and when a HttpResponseMessage like HttpStatusCode.OK on an WebAPI controller.
Is it when you don't expect nothing in return, that's when you return a HttpResponseMessage?
This is totally depends on what you wish to return.
The HttpResponseMessage should contain both, even when you return a class, you better set the HttpStatusCode.OK so the receiver would first check if its OK, and only then take the content and serialize it to class or what ever you have done with it.