public async Task <ActionResult> DeleteConfirmed(int id)
        {
            Car car = await _carServices.FindCar(id);

            await _carServices.DeleteCar(car);

            TempData["msgSuccess"] = "Car Deleted";
            return(RedirectToAction("Index"));
        }
Example #2
0
        public async Task <IActionResult> Delete(int Id)
        {
            var output = new Response();

            try
            {
                await _carservices.DeleteCar(Id);

                output.exito   = 1;
                output.message = "Borrado con Exito.";

                return(Ok(output));
            }
            catch (Exception e)
            {
                output.exito   = 0;
                output.message = e.Message;

                return(BadRequest(output));
            }
        }
Example #3
0
 public void DeleteCar(long id)
 {
     _service.DeleteCar(id);
 }