Example #1
0
 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;
     }
 }
Example #2
0
 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;
     }
 }
Example #3
0
 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;
     }
 }