public async Task <IActionResult> Put(int id, [FromBody] NoteParams value, CancellationToken cancellationToken) { var res = _noteService.FindById(id); if (res == null) { return(NotFound()); } res = await _noteService.UpdateAsync(id, value.Title, value.Text, cancellationToken); return(Ok(res)); }
public async Task <IActionResult> Post([FromBody] NoteParams input, CancellationToken cancellationToken) { var res = await _noteService.CreateAsync(input.Title, input.Text, cancellationToken); return(Ok(res)); }