public async Task <IActionResult> ChangeStatus(int?id) { var billpay = await billmanager.GetBillPay(id); if (billpay == null) { return(NotFound()); } billmanager.Block(billpay, !billpay.Block); //Change to true(Block) or false(Unblock) when switch is toogled return(RedirectToAction("List", "SchedulePayManager")); }