How to create subfolders for Api in asp.net webapi?

1

By default, the folder is Controllers

I'd like to create other sub-folders

Controllers - > Api - > Another folder / other folder2 etc.

How do I do this? and how do you configure the router for it?

    
asked by anonymous 25.08.2014 / 17:47

1 answer

1

The only thing that came to me right now is the creation of Area, like:

Insidethe%w/woftheAreaVowpublic 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 you create the Area . To use also if no route nomenclature is elaborated, it is the same as in the example file: Controller , following the default template.

    
25.08.2014 / 18:13