public IHttpActionResult GetFromMixedArg(int id, [FromUri] ComplexModel dataArg) { return(Ok(new NestedModel() { Id = id, ComplexModel = dataArg })); }
public TotalResult PostFromMixedArg2(string simpleStr, [FromUri] ComplexModel uriComplexArg, [FromBody] NestedModel bodyNestedArg) { return(new TotalResult() { SimpleStr = simpleStr, ComplexModel = uriComplexArg, NestedModel = bodyNestedArg }); }
public TotalResult PostFromMixedArg(string simpleStr, [FromUri] NestedModel uriNestedArg, [FromBody] ComplexModel bodyComplexArg) { /* * this will not work in proxy client, because uriNestedArg will not generate * a uri for client to post,but it can be support in proxyTemplate.tt * if nested class[array,list...] is used for uri parameters binding become more common. * * but this can be request from browser[post uri with body part], it means this Action has no problem. */ return(new TotalResult() { SimpleStr = simpleStr, ComplexModel = bodyComplexArg, NestedModel = uriNestedArg }); }
public IHttpActionResult GetFromComplexArg([FromUri] ComplexModel dataArg) { return(Ok(dataArg)); }