public async Task UpdateClienteAsync(Cliente cliente) { try { using FleetManContext context = new FleetManContext(); AttachItem(cliente, context); context.Entry(cliente).State = EntityState.Modified; await context.SaveChangesAsync(); } catch (Exception ex) { throw ex; } }
public async Task UpdateVeiculoAsync(Veiculo veiculo) { try { using FleetManContext context = new FleetManContext(); AttachItem(veiculo, context); context.Entry(veiculo).State = EntityState.Modified; await context.SaveChangesAsync(); } catch (Exception ex) { throw ex; } }
public async Task UpdateMotoristaAsync(Motorista motorista) { try { using FleetManContext context = new FleetManContext(); AttachItem(motorista, context); context.Entry(motorista).State = EntityState.Modified; await context.SaveChangesAsync(); } catch (Exception ex) { throw ex; } }