I'm trying to create a response which sends the HttpStatusCode
along with a dynamic
object like this:
var t = _rep.GetOrders(params, sft);
...........
return Request.CreateResponse(HttpStatusCode.OK, Enumerable.Select(t,
(Func<Order, dynamic>)(x =>
new
{
x.Id,
x.Name,
.....
})));
But it gives me this error message:
'System.Net.Http.HttpRequestMessage' has no applicable method named 'CreateResponse' but appears to have an extension method by that name. Extension methods cannot be dynamically dispatched. Consider casting the dynamic arguments or calling the extension method without the extension method syntax.
I don't quite understand what it's saying, or what I'm doing wrong here.
Can anyone shine some light on this matter please?