Ejemplo n.º 1
0
        public async Task <IActionResult> UpdateInterest([FromBody] InterestUpdateViewModel updateInterest)
        {
            var updatedInterest = await _interestService.Update(updateInterest);

            if (updateInterest == null)
            {
                return(BadRequest("An Interest with the given Id does not exist"));
            }

            return(NoContent());
        }
Ejemplo n.º 2
0
        public async Task <Interest> Update(InterestUpdateViewModel updateInterest)
        {
            Interest existingInterest = await _interestRepository.GetById(updateInterest.Id);

            if (existingInterest == null)
            {
                return(null);
            }

            return(await _interestRepository.Update(
                       _mapper.Map <Interest>(updateInterest)));
        }