Routes with different controllers but same action name fails to produce wanted urls

前端 未结 3 1052
走了就别回头了
走了就别回头了 2021-02-19 08:50

I am trying to set up a API for my MVC web app that will have a lot of routes but much of the same part for each one. Basically a CRUD for each area. I am also setting it up t

3条回答
  •  梦毁少年i
    2021-02-19 09:37

    Another possible solution is:

    // other solution
    [Route("aim/v1/contacts/[Action]")]
    public class aimContactsController : Controller
    {
        [HttpPost("{id}")]
        public IActionResult delete(string id)
        {
            // omitted ...
        }
    }
    

提交回复
热议问题