I notice that there are a bunch of similar questions out there about this topic.
I\'m getting this error when calling any of the methods below.
You can have a dispatcher endpoint that will get the calls from both endpoints and will call the right based on parameters. (It will works fine if their are in same controller).
Example:
// api/menus/{menuId}/menuitems
[HttpGet("{menuId}/menuitems")]
public IActionResult GetAllMenuItemsByMenuId(int menuId, int? userId)
{
if(userId.HasValue)
return GetMenuItemsByMenuAndUser(menuId, userId)
.... original logic
}
public IActionResult GetMenuItemsByMenuAndUser(int menuId, int userId)
{
...
}