// 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)); }
public ColorViewModel GetColor(int id) { return(Mapper.Map <Color, ColorViewModel>(_colorRepository.FindById(id))); }
public async Task <ColorViewModel> GetColor(int id) { return(new ColorViewModel().Map(await _colorRepository.FindById(id))); }