/// <summary> /// Delete Vehicle Make /// </summary> public void DeleteVehicleMake(long vehicleMakeId) { VehicleMake dbversion = vehicleMakeRepository.Find(vehicleMakeId); CheckVehicleMakeAssociations(vehicleMakeId); if (dbversion == null) { throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Vehicle Make with Id {0} not found!", vehicleMakeId)); } vehicleMakeRepository.Delete(dbversion); vehicleMakeRepository.SaveChanges(); }
public async Task <bool> DeleteVehicleMake(object id) { try { await _repository.Delete(id); await uow.SaveChangesAsync(); return(true); } catch { return(false); } }
public async Task <int> DeleteVehicleMake(IVehicleMakeDomainModel entity) { return(await _vehicleMakeRepository.Delete(entity)); }
public async Task <IActionResult> Delete(int id) { await context.Delete(id); return(RedirectToAction("Index")); }