コード例 #1
0
        public ActionResult Delete(int CPlantilla)
        {
            var plantilla = servicioPlantilla.Listar()
                            .Where(t => t.CodPlantilla == CPlantilla)
                            .FirstOrDefault();

            servicioPlantilla.Eliminar(plantilla);

            return(RedirectToAction("Index"));
        }
コード例 #2
0
        public ActionResult Delete(int id, [FromBody] Plantilla plantilla)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id == plantilla.CodPlantilla)
            {
                servicioPlantilla.Eliminar(plantilla);
            }
            else
            {
                return(NotFound());
            }
            return(new  CreatedAtRouteResult("GetPlantilla", id = plantilla.CodPlantilla, plantilla));
        }