public async Task <IDataResult <Product> > GetProductByIdAsync(int id)
        {
            var result = await _productDal.GetByIdAsync(id);

            result.PictureUrl = result.PictureUrl.Insert(0, _apiUrl);

            return(new SuccessDataResult <Product>(result));
        }
Ejemplo n.º 2
0
        public IDataResult <Product> GetByIdAsync(int entity)
        {
            var _getByIdAsync = _productDal.GetByIdAsync(entity).Result;

            if (_getByIdAsync == null)
            {
                return(new ErrorDataResult <Product>(ProductMessages.RecordNotFound));
            }
            return(new SuccessDataResult <Product>(_getByIdAsync, ProductMessages.ProductListed));
        }
Ejemplo n.º 3
0
 public async Task <Product> GetByIdAsync(int id)
 {
     return(await _appProductDal.GetByIdAsync(id));
 }
Ejemplo n.º 4
0
        public async Task <Product> GetByIdAsync(int id)
        {
            var cancelToken = new CancellationTokenSource();

            return(await _productDal.GetByIdAsync(id, cancelToken.Token));
        }