public IActionResult Delete(int IdP) { var PlanAux = PlanList.GetPlan(IdP); if (PlanAux == null) { return(NotFound()); } if (!PlanList.RemovePlan(IdP)) { return(BadRequest()); } return(Ok("Plan removed!")); }
public ActionResult <Plan> Get(int IdP) { try { var PlanAux = PlanList.GetPlan(IdP).First(); if (PlanAux == null) { return(BadRequest()); } return(Ok(PlanAux)); } catch (InvalidOperationException) { return(NotFound()); } }