public async Task <IActionResult> PutAppraise(int id, Appraise appraise) { if (id != appraise.AppraiseId) { return(BadRequest()); } _context.Entry(appraise).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AppraiseExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutUsers(int id, Users users) { if (id != users.UsersId) { return(BadRequest()); } _context.Entry(users).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UsersExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutCar(int id, Car car) { if (id != car.CarId) { return(BadRequest()); } _context.Entry(car).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CarExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutOrders(int id, Orders orders) { _logger.LogInformation("修改支付状态,订单编号:" + id); if (id != orders.OrdersId) { _logger.LogInformation("修改支付状态失败,订单编号:" + id); return(BadRequest()); } _context.Entry(orders).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!OrdersExists(id)) { return(NotFound()); } else { throw; } } _logger.LogInformation("修改支付状态成功,订单编号:" + id); return(NoContent()); }
public async Task <IActionResult> PutPhoto(int id, Photo photo) { if (id != photo.PhotoId) { return(BadRequest()); } _context.Entry(photo).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PhotoExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutOrdersDetail(int id, OrdersDetail ordersDetail) { if (id != ordersDetail.OrdersDetailId) { return(BadRequest()); } _context.Entry(ordersDetail).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!OrdersDetailExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutDelivery(int id, Delivery delivery) { if (id != delivery.DeliveryId) { return(BadRequest()); } _context.Entry(delivery).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DeliveryExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }