public HttpResponseMessage GetAllByIdShop(HttpRequestMessage request, int id) { IEnumerable <SanPham> sanPhamAllByIdNguoiDung = null; var toTal = 0; try { sanPhamAllByIdNguoiDung = _sanPhamService.GetAllByIdShop(id); toTal = sanPhamAllByIdNguoiDung.ToList().Count; if (toTal > 0) { Message = "Thông tin danh sach sản phẩm với id shop"; } else { throw new DbEntityValidationException(string.Format("Không tìm kiếm được thông tin sản phẩm với id shop {0}", id)); } } catch (DbEntityValidationException ex) { LogException(ex); } return(GetResponseMessage(IsSuccess, Message, toTal, sanPhamAllByIdNguoiDung)); }