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)); }
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)); }
public async Task <Product> GetByIdAsync(int id) { return(await _appProductDal.GetByIdAsync(id)); }
public async Task <Product> GetByIdAsync(int id) { var cancelToken = new CancellationTokenSource(); return(await _productDal.GetByIdAsync(id, cancelToken.Token)); }