Given the following two urls:
- /employee/list/active
- /employee/list/inactive
How do I map the active/inactive part of the url to a boolean action method parameter, active being true, inactive being false?
[Route("employee/list")]
public ActionResult List(bool? active = null)
enumnotbool?in your case othewise you should write customModelBinder./employee/list/trueand/employee/list/false? You cannot map "active" and "inactive" to a boolean property.