Example #1
0
        public HttpResponseMessage GetAllByIdShopForTrue(HttpRequestMessage request, int id)
        {
            IEnumerable <SanPham> sanPhamAllByIdNguoiDung = null;
            var toTal = 0;

            try
            {
                sanPhamAllByIdNguoiDung = _sanPhamService.GetAllByIdShopForTrue(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));
        }