Ejemplo n.º 1
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            VehicleMake vehicleMake = await _vehicleService.GetMakeById(id);

            await _vehicleService.DeleteMake(vehicleMake);

            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> DeleteConfirmed(Guid?id)
        {
            if (id == null)
            {
                return(BadRequest());
            }
            try
            {
                await service.DeleteMake(id);

                return(RedirectToAction("Index"));
            }

            catch (DbUpdateException)
            {
                return(RedirectToAction(nameof(Delete), new { id = id, saveChangesError = true }));
            }
        }
Ejemplo n.º 3
0
        //DELETE: api/makes/:id
        public async Task <IHttpActionResult> Delete(int id)
        {
            await Service.DeleteMake(id);

            return(Ok());
        }