Example #1
0
        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!"));
        }
Example #2
0
 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());
     }
 }