public async Task <IActionResult> Post(FrequencyForAddDTO model)
        {
            Frequency frequency = mapper.Map <Frequency>(model);
            await frequencyRepository.Add(frequency).ConfigureAwait(true);

            await unitOfWork.CompleteAsync().ConfigureAwait(true);

            return(Ok(mapper.Map <FrequencyForGetDTO>(await frequencyRepository.Get(frequency.Id).ConfigureAwait(true))));
        }
Beispiel #2
0
 public IActionResult Post([FromBody] Frequency frequency)
 {
     if (frequency == null)
     {
         return(BadRequest("Faile to Add new Frequency"));
     }
     _repository.Add(frequency);
     return(Created($"api/frequencies/{frequency.Value}", frequency));
 }