예제 #1
0
 public TodoViewModel Get(int id)
 {
     try
     {
         return(Mapper.Map <Todo, TodoViewModel>(_todoApp.GetById(id)));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #2
0
        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);
        }
예제 #3
0
        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));
        }
예제 #4
0
 public async Task <TodoAppViewModel> Get([FromRoute] Guid id)
 {
     return(await _todoAppService.GetById(id));
 }
예제 #5
0
        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));
        }
예제 #7
0
 public TodoVM GetById(int id)
 {
     return(appService.GetById(id));
 }