public IActionResult Update(int id, [FromBody] TimeEntry theUpdate)
 {
     if (!_repository.Contains(id))
     {
         return(NotFound());
     }
     return((IActionResult)Ok(_repository.Update(id, theUpdate)));
 }
Beispiel #2
0
 public IActionResult Update(long Id, [FromBody] TimeEntry timeEntry)
 {
     _operationCounter.Increment(TrackedOperation.Update);
     if (_iTimeEntryRepository.Contains(Id))
     {
         return(Ok(_iTimeEntryRepository.Update(Id, timeEntry)));
     }
     return(NotFound());
 }
Beispiel #3
0
 public IActionResult Update(int id, [FromBody] TimeEntry theUpdate)
 {
     _operationCounter.Increment(TrackedOperation.Update);
     if (!_repository.Contains(id))
     {
         return(NotFound());
     }
     return((IActionResult)Ok(_repository.Update(id, theUpdate)));
 }
        public async Task <TimeEntryResponse> EditTimeEntryAsync(EditTimeEntryRequest req)
        {
            var entry  = _mapper.Map(req);
            var result = _repo.Update(entry);
            await _repo.UnitOfWork.SaveChangesAsync();

            var confirmResult = await _repo.GetEntryAsync(req.Id);

            return(_mapper.Map(confirmResult));
        }
Beispiel #5
0
        public IActionResult Update(long id, [FromBody] TimeEntry timeEntry)
        {
            counter.Increment(TrackedOperation.Update);
			TimeEntry updatedTimeEntry;
			if (!repo.Contains(id))
			{
				return NotFound();
			}
			updatedTimeEntry =repo.Update(id, timeEntry);
			return new OkObjectResult(updatedTimeEntry);
        }
Beispiel #6
0
        public IActionResult Update(long id, [FromBody] TimeEntry entry)
        {
            _operationCounter.Increment(TrackedOperation.Update);

            if (!_timeEntryRepository.Contains(entry.Id.GetValueOrDefault(id)))
            {
                return(NotFound());
            }

            entry = _timeEntryRepository.Update(id, entry);
            return(Ok(entry));
        }
        public IActionResult Update(long id, [FromBody] TimeEntry timeEntry)
        {
            TimeEntry timeEntryUpdated;

            if (!_inMemoryTimeEntryRepository.Contains(id))
            {
                return(NotFound());
            }

            timeEntryUpdated = _inMemoryTimeEntryRepository.Update(id, timeEntry);
            return(new OkObjectResult(timeEntryUpdated));
        }
 public IActionResult Update(long id, [FromBody] TimeEntry timeEntry)
 {
     if (_repository.Contains(id))
     {
         _operationCounter.Increment(TrackedOperation.Update);
         return(Ok(_repository.Update(id, timeEntry)));
     }
     else
     {
         return(NotFound());
     }
 }
 public ActionResult Update(int id, [FromBody] TimeEntry theUpdate)
 {
     _operationCounter.Increment(TrackedOperation.Update);
     if (_timeEntryRepository.Contains(id))
     {
         var response = _timeEntryRepository.Update(id, theUpdate);
         return(new OkObjectResult(response));
     }
     else
     {
         return(new NotFoundResult());
     }
 }
Beispiel #10
0
        public IActionResult Update(long id, [FromBody] TimeEntry timeEntry)
        {
            _counter.Increment(TrackedOperation.Update);

            if (_repository.Contains(id) == false)
            {
                return(new NotFoundResult());
            }

            TimeEntry updatedEntry = _repository.Update(id, timeEntry);

            return(new OkObjectResult(updatedEntry));
        }
        public IActionResult Update(long id, [FromBody] TimeEntry timeEntry)
        {
            _operationCounter.Increment(TrackedOperation.Update);
            TimeEntry timeEntry1 = _timeEntryRepository.Update(id, timeEntry);

            if (timeEntry1 == null)
            {
                return(NotFound());
            }
            else
            {
                return(Ok(timeEntry1));
            }
        }
 public IActionResult Update(long id, [FromBody] TimeEntry timeEntry)
 {
     return(_repository.Contains(id) ? (IActionResult)Ok(_repository.Update(id, timeEntry)) : NotFound());
 }
Beispiel #13
0
        public IActionResult Update(long id, [FromBody] TimeEntry timeEntry)
        {
            _operationCounter.Increment(TrackedOperation.Update);

            return(_timeEntryRepository.Contains(id) ? (IActionResult)Ok(_timeEntryRepository.Update(id, timeEntry)) : NotFound());
        }