I want to pass object as parameter in my web api GET and POST method. My code is,
[HttpGet]
[Route("mytest/list/{model}")]
public IHttpActionResult GetAllTypes(TestModel model)
{
//my logic here
}
When I call this, console get an error its not found. I tried this,
[HttpGet]
[Route("mytest/list/{model?}")]
public IHttpActionResult GetAllTypes(TestModel model)
{
//my logic here
}
But, the parameter object gets null value.