public async Task <IVehicleModel> FindById(object id) { VehicleModelEntityModel entity = await _genericRepository.FindById(id); IVehicleModel model = iMapper.Map <VehicleModel>(entity); return(model); }
public void Delete(IVehicleModel vehicleModel) { try { VehicleModelEntityModel entityToDelete = iMapper.Map <VehicleModelEntityModel>(vehicleModel); _genericRepository.Delete(entityToDelete); } catch (Exception) { throw; } }
public async Task <bool> Edit(IVehicleModel vehicleModel) { try { VehicleModelEntityModel entity = iMapper.Map <VehicleModelEntityModel>(vehicleModel); await _genericRepository.Edit(entity); return(true); } catch { return(false); } }
public async Task <bool> Delete(object id) { try { VehicleModelEntityModel entity = await _genericRepository.FindById(id); await Delete(entity); return(true); } catch { return(false); } }