1
By default, the folder is Controllers
I would like to create other subfolders
Controllers -> Api -> Othern/ Other2 etc
How do I do this? and how do you configure the router for this?
1
By default, the folder is Controllers
I would like to create other subfolders
Controllers -> Api -> Othern/ Other2 etc
How do I do this? and how do you configure the router for this?
1
The only thing that came to me at the time is the creation of Area, as:
Within the Controller
of Area Vow has a DadosController
which is a WebApi
, follows the code:
public class DadosController : ApiController
{
// GET api/<controller>
public IEnumerable<string> Get()
{
return new string[] { "value1", "value2" };
}
// GET api/<controller>/5
public string Get(int id)
{
return "value";
}
// POST api/<controller>
public void Post([FromBody]string value)
{
}
// PUT api/<controller>/5
public void Put(int id, [FromBody]string value)
{
}
// DELETE api/<controller>/5
public void Delete(int id)
{
}
}
Running in the same way:
The route settings in this case are already done automatically when creating the Area. To use also if no different route nomenclature is elaborated is the way it is in the example file: GET api/<controller>
, following the standard model.
Browser other questions tagged asp.net-web-api
You are not signed in. Login or sign up in order to post.