public async Task <IActionResult> PutVehicletype(int id, Vehicletype vehicletype) { if (id != vehicletype.Id) { return(BadRequest()); } _context.Entry(vehicletype).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!VehicletypeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutAddress(int id, Address address) { if (id != address.Id) { return(BadRequest()); } _context.Entry(address).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AddressExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
private IActionResult GetDetailsView(string viewName, int id) { var model = Mapper.Map <AuditLog, AuditLogDetailDto>(_dbContext.AuditLogs.First(log => log.Id == id)); _dbContext.Entry(model).State = EntityState.Detached; var userTask = _userManager.FindByIdAsync(model.UserId); userTask.Wait(); model.UserId = userTask.Result.DisplayName; return(View(viewName, model)); }
public async Task Update(User user, TrackingContext context) { context.Entry(user).State = EntityState.Modified; await context.SaveChangesAsync(); }
public async Task Close(Shipment ship, TrackingContext context) { ship.IsClosed = Contants.CLOSED; context.Entry(ship).State = EntityState.Modified; await context.SaveChangesAsync(); }
public async Task Update(Shipment ship, TrackingContext context) { ship = setUpper(ship); context.Entry(ship).State = EntityState.Modified; await context.SaveChangesAsync(); }
public async Task Update(Contact contact, TrackingContext context) { context.Entry(contact).State = EntityState.Modified; await context.SaveChangesAsync(); }
public async Task Update(Flow flow, TrackingContext context) { context.Entry(flow).State = EntityState.Modified; await context.SaveChangesAsync(); }