static public void updatePoint(Point point) { using (PointRepository Pointrepo = new PointRepository()) { Pointrepo.Update(point); Pointrepo.Save(); } }
public async Task <PointUpdateTransactionResponse> Handle(PointUpdateTransactionRequest request, CancellationToken cancellationToken) { var point = await PointRepository.Update(request.Point.Id, request.Point.Name, cancellationToken); PointUpdateTransactionResponse response = new PointUpdateTransactionResponse(); response.Point = new Model.PointModel() { Id = point.Id, Name = point.Name }; return(response); }
public async Task <IActionResult> Update(int id, Point model) { var point = await _pointRepository.GetById(model.Id); if (point == null) { return(NotFound()); } var updated = await _pointRepository.Update(model); return(Ok(updated)); }