public IActionResult Details(int id) { ViewData["BodyClass"] = "dichvu-page"; var model = new DetailDichVuViewModel(); model.DichVu = _dichvuService.GetById(id); model.DichVuCategory = _dichvuCategoryService.GetById(model.DichVu.CategoryId); model.RelatedDichVus = _dichvuService.GetRelatedDichVus(id, 9); model.Tags = _dichvuService.GetListTagById(id); return(View(model)); }
public HttpResponseMessage GetById(HttpRequestMessage request, int id) { DichVu dichVuSinger = null; try { dichVuSinger = _dichVuService.GetById(id); if (dichVuSinger != null) { Message = "Thông tin dich vu với id: " + id; } else { throw new DbEntityValidationException(string.Format("Không tìm kiếm được dich vu với id {0}", id)); } } catch (DbEntityValidationException ex) { LogException(ex); } return(GetResponseMessage(IsSuccess, Message, 1, dichVuSinger)); }