public async Task <IActionResult> Delete(DeleteVehicleTypeViewModel model) { var success = await this.vehicleTypesService.RemoveAsync(model.Id); if (!success) { return(this.RedirectToAction("Error", "Home")); // TODO: redirect } return(this.RedirectToAction("All", "VehicleTypes")); }
public IActionResult Delete(int id) { VehicleTypeServiceModel vehicleType = this.vehicleTypesService.GetById(id); if (vehicleType.Name == null) { return(this.BadRequest()); } var model = new DeleteVehicleTypeViewModel { Id = vehicleType.Id, Name = vehicleType.Name, Description = vehicleType.Description, VehicleCategory = vehicleType.VehicleCategory.ToString(), //TODO: Add services table on delete view }; return(this.View(model)); }