public async Task <IActionResult> AddNewInterest([FromBody] InterestCreateViewModel newInterest) { var addedInterest = await _interestService.Add(newInterest); return(CreatedAtAction(nameof(GetInterestById), new { id = addedInterest.Id }, addedInterest)); }
public async Task <Interest> Add(InterestCreateViewModel newInterest) { return(await _interestRepository.Add( _mapper.Map <Interest>(newInterest))); }