public DataRespond GetPrById(int id)
        {
            DataRespond data = new DataRespond();

            try
            {
                data.success = true;
                data.data    = _iproductResponsitory.GetProductById(id);
                var item = _iproductResponsitory.GetOnlyProduct(id);
                item.totalview = item.totalview + 1;
                _iproductResponsitory.UpdateToTalView(item);
            }
            catch (Exception e)
            {
                data.success = false;
                data.error   = e;
            }
            return(data);
        }
Exemple #2
0
 public dynamic GetProductByID(int id)
 {
     return(_iproductResponsitory.GetProductById(id));
 }