Пример #1
0
        public ActionResult Editar(int id)
        {
            var tarefa = _tarefaService.BuscarPorId(id);

            if (tarefa == null)
            {
                return(RedirectToAction("Listar"));
            }

            ViewBag.t = tarefa;
            return(View());
        }
Пример #2
0
        public async Task <TarefaViewModel> BuscarPorId(Guid id)
        {
            TarefaViewModel tarefa = null;

            try
            {
                tarefa = _mapper.Map <TarefaViewModel>(await _tarefaService.BuscarPorId(id));
            }
            catch (Exception ex)
            {
                //TODO: Log
            }

            return(tarefa);
        }