public TodoViewModel Get(int id) { try { return(Mapper.Map <Todo, TodoViewModel>(_todoApp.GetById(id))); } catch (Exception ex) { throw ex; } }
public Results.GenericResult <TodoDto> Get(int id) { var result = new Results.GenericResult <TodoDto>(); try { result.Result = appService.GetById(id); result.Success = true; } catch (Exception ex) { result.Errors = new string[] { ex.Message }; } return(result); }
public async Task <IActionResult> Details(Guid?id) { if (id == null) { return(NotFound()); } var task = await _todoAppService.GetById(id.Value); if (task == null) { return(NotFound()); } return(View(task)); }
public async Task <TodoAppViewModel> Get([FromRoute] Guid id) { return(await _todoAppService.GetById(id)); }
public async Task <ActionResult <Todo> > GetById(Guid id) { var todo = _mapper.Map <TodoViewModel>(await _todoAppService.GetById(id)); return(Ok(todo)); }
public async Task <IActionResult> Details(Guid id) { var todo = _mapper.Map <TodoViewModel>(await _todoAppService.GetById(id)); return(View(todo)); }
public TodoVM GetById(int id) { return(appService.GetById(id)); }