public async Task DeleteVehiculoAsync(ReporteVehiculo RV) //BORRA VEHICULOS { try { dbContext.ReportesVe.Remove(RV); await dbContext.SaveChangesAsync(); } catch (Exception) { throw; } }
public async Task <ReporteVehiculo> AddVehiculoAsync(ReporteVehiculo RV) // GUARDA VEHICULOS { try { dbContext.ReportesVe.Add(RV); await dbContext.SaveChangesAsync(); } catch (Exception) { throw; } return(RV); }
public async Task <ReporteVehiculo> UpdateVehiculoAsync(ReporteVehiculo Rv) //ACTUALIZA { try { var VehiculoExiste = dbContext.ReportesVe.FirstOrDefaultAsync( veh => veh.IdReporteVehiculo == Rv.IdReporteVehiculo); if (VehiculoExiste != null) { dbContext.Update(Rv); await dbContext.SaveChangesAsync(); } } catch (Exception) { throw; } return(Rv); }