/// <summary> /// Delete Vehicle Model /// </summary> public void DeleteVehicleModel(long vehicleModelId) { VehicleModel dbversion = vehicleModelRepository.Find(vehicleModelId); CheckVehicleModelAssociations(vehicleModelId); if (dbversion == null) { throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Vehicle Model with Id {0} not found!", vehicleModelId)); } vehicleModelRepository.Delete(dbversion); vehicleModelRepository.SaveChanges(); }
public ActionResult Delete(int?Id) { if (Id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var model = service.Delete(Id); if (model == null) { return(HttpNotFound()); } return(View(model)); }
public async Task <bool> DeleteVehicleModel(object id) { try { await _vehicleModelRepository.Delete(id); await _unitOfWork.SaveChangesAsync(); return(true); } catch { return(false); } }
public async Task <int> DeleteVehicleModel(IVehicleModelDomainModel entity) { return(await _vehicleModelRepository.Delete(entity)); }