I have an ASP .Net Core 1.1 Web Api. In one of my controllers, I'd like two actions:
[HttpGet("{userId:int}")] public async Task<IActionResult> GetUser([FromRoute] int id) { return Ok(_context.User.Where(u.Id == id)); } [HttpGet("{groupId:int}")] public async Task<IActionResult> GetUsersInGroup([FromRoute] int groupId) { return Ok(_context.User.Where(u.GroupId == groupId)); }
Both actions have the same signature, except for the method name. How can I make it so that I can call upon the one or the other?
Thanks...