public async Task <ActionResult <TaskDto> > Get([Required] int id) { var task = await _taskDatabase.FindOrDefault(id); if (task == null) { return(NotFound()); } else { var taskDto = new TaskDto(); taskDto.Title = task.Title; taskDto.Description = task.Description; return(taskDto); } }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } Task = await _context.FindOrDefault(id.Value); if (Task == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } Task = await _taskContext.FindOrDefault(id.Value); if (Task == null) { return(NotFound()); } ViewData["ProjectId"] = new SelectList(_projectDatabase.GetAll(), "Id", "Title"); return(Page()); }