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()); }
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))); }