Exemplo n.º 1
0
 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());
 }
Exemplo n.º 2
0
        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());
        }