public async Task <ActionResult <TodoUser> > GetTodoRuns(int id) { await Db.Connection.OpenAsync(); var query = new RunPostQuery(Db); var result = await query.FindOneAsync(id); JsonConvert.SerializeObject(result); if (result is null) { return(new NotFoundResult()); } return(new OkObjectResult(result)); }
public async Task <IActionResult> PutTodoRuns(int id, [FromQuery] TodoRun todoRun) { await Db.Connection.OpenAsync(); var query = new RunPostQuery(Db); var result = await query.FindOneAsync(id); if (result is null) { return(new NotFoundResult()); } result.Id_run = todoRun.Id_run; result.Score = todoRun.Score; result.Date = todoRun.Date; result.Id_character = todoRun.Id_character; await result.UpdateAsync(); JsonConvert.SerializeObject(result); return(new OkObjectResult(result)); }