Beispiel #1
0
        public ActionResult Delete(int CPaquete)
        {
            var Paquete = servicioPaquete.Listar()
                          .Where(t => t.CodPaquete == CPaquete)
                          .FirstOrDefault();

            servicioPaquete.Eliminar(Paquete);

            return(RedirectToAction("Index"));
        }
        public ActionResult Delete(int id, [FromBody] Paquete paquete)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id == paquete.CodPaquete)
            {
                servicioPaquete.Eliminar(paquete);
            }
            else
            {
                return(NotFound());
            }
            return(new  CreatedAtRouteResult("GetPaquete", id = paquete.CodPaquete, paquete));
        }