Example #1
0
 public IHttpActionResult GetFromMixedArg(int id, [FromUri] ComplexModel dataArg)
 {
     return(Ok(new NestedModel()
     {
         Id = id,
         ComplexModel = dataArg
     }));
 }
Example #2
0
 public TotalResult PostFromMixedArg2(string simpleStr, [FromUri] ComplexModel uriComplexArg, [FromBody] NestedModel bodyNestedArg)
 {
     return(new TotalResult()
     {
         SimpleStr = simpleStr,
         ComplexModel = uriComplexArg,
         NestedModel = bodyNestedArg
     });
 }
Example #3
0
        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
            });
        }
Example #4
0
 public IHttpActionResult GetFromComplexArg([FromUri] ComplexModel dataArg)
 {
     return(Ok(dataArg));
 }