public async Task <object> GetResponse(HttpContent content, Type returnType) { return(await new MediaTypeProc(content) .Supports("application/json", async c => await ResponseProcessorConverter.ReadObjectJson(content, returnType)) .Supports("application/xml", async c => await ResponseProcessorConverter.ReadObjectXml(content, returnType)) .GetResult()); }
public async Task <object> GetResponse(HttpContent content, Type returnType) { var listType = typeof(List <>).MakeGenericType(returnType.GetGenericArguments()); return(await new MediaTypeProc(content) .Supports("application/json", async c => await ResponseProcessorConverter.ReadObjectJson(content, listType)) .Supports("application/xml", async c => await ResponseProcessorConverter.ReadObjectXml(content, listType)) .GetResult()); }