I have an action method which is called by javascript on the front-end using $.getJSON(path) which looks something like below in order to populate a dropdownlist:
[HttpGet]
public List<SelectListItem> GetSomeList(int cId)
{...}
I now need to modify it so that I can return some custom logic based errors based on certain conditions. What's the best way to go here? Should I follow this and go with IActionResult? Please note my question is more specific to Core MVC and not Web API.