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(); }
public RequestUpdateAnswer(DtoAnswer answer) { Endpoint = string.Format($"/answers/{answer.Id}"); ContentBody = new StringContent( JsonConvert.SerializeObject(answer)); ContentBody.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json"); }
public async Task UpdateAnswerAsync(DtoAnswer answer) => await _context.HttpPutAsync <ResponseBase>(new RequestUpdateAnswer(answer));
public async Task <IActionResult> Put(int id, [FromBody] DtoAnswer answer) => Ok(await _servAnswers.UpdateAnswerAsync(id, answer));