コード例 #1
0
 static public void updatePoint(Point point)
 {
     using (PointRepository Pointrepo = new PointRepository())
     {
         Pointrepo.Update(point);
         Pointrepo.Save();
     }
 }
コード例 #2
0
        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);
        }
コード例 #3
0
        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));
        }