// GET: ColorController/Details/5
        public async Task <ActionResult> Details(int id)
        {
            var colors = await _repo.FindById(id);

            var model = _mapper.Map <Color, ColorVM>(colors);

            if (model == null)
            {
                return(NotFound());
            }
            return(View(model));
        }
        public ColorViewModel GetColorbyId(int id)
        {
            var color = _colorRepository.FindById(id);

            return(Mapper.Map <Color, ColorViewModel>(color));
        }
Пример #3
0
 public ColorViewModel GetColor(int id)
 {
     return(Mapper.Map <Color, ColorViewModel>(_colorRepository.FindById(id)));
 }
Пример #4
0
 public async Task <ColorViewModel> GetColor(int id)
 {
     return(new ColorViewModel().Map(await _colorRepository.FindById(id)));
 }