Esempio n. 1
0
        public async Task <ActionResult <DetailViewModel> > Get(int id)
        {
            var user = await _detailService.GetByIdAsync(id, Bll.Extensions.DetailExtensions.ToDto);

            if (user == null)
            {
                return(NotFound(nameof(DetailViewModel)));
            }

            return(Ok(user.ToViewModel()));
        }
Esempio n. 2
0
        public async Task <ActionResult <DetailDTO> > GetID(long id)
        {
            var detail = await _detailService.GetByIdAsync(id);

            return(Ok(detail));
        }
 public async Task <Detail> GetById(int id)
 {
     return(await detailService.GetByIdAsync(id));
 }