Exemple #1
0
        public async Task <IActionResult> AddNewInterest([FromBody] InterestCreateViewModel newInterest)
        {
            var addedInterest = await _interestService.Add(newInterest);

            return(CreatedAtAction(nameof(GetInterestById), new { id = addedInterest.Id }, addedInterest));
        }
Exemple #2
0
 public async Task <Interest> Add(InterestCreateViewModel newInterest)
 {
     return(await _interestRepository.Add(
                _mapper.Map <Interest>(newInterest)));
 }