Example #1
0
        public async Task <AnswerBase> UpdateAnswerAsync(int answId, DtoAnswer answer)
        {
            var answ = await _repoAnswers.GetAnswerByIdAsync(answId);

            await _repoAnswers.EditAnswerAsync(_mapper.Map(answer, answ));

            throw new System.NotImplementedException();
        }
Example #2
0
 public RequestUpdateAnswer(DtoAnswer answer)
 {
     Endpoint    = string.Format($"/answers/{answer.Id}");
     ContentBody = new StringContent(
         JsonConvert.SerializeObject(answer));
     ContentBody.Headers.ContentType
         = MediaTypeHeaderValue.Parse("application/json");
 }
Example #3
0
 public async Task UpdateAnswerAsync(DtoAnswer answer)
 => await _context.HttpPutAsync <ResponseBase>(new RequestUpdateAnswer(answer));
Example #4
0
 public async Task <IActionResult> Put(int id, [FromBody] DtoAnswer answer)
 => Ok(await _servAnswers.UpdateAnswerAsync(id, answer));