Ejemplo n.º 1
0
        public IDataResult <List <Product> > GetAllAsync(Expression <Func <Product, bool> > filter = null)
        {
            var _getAllAsync = _productDal.GetAllAsync(filter).Result;

            if (_getAllAsync == null)
            {
                return(new ErrorDataResult <List <Product> >(ProductMessages.RecordNotFound));
            }
            return(new SuccessDataResult <List <Product> >(_getAllAsync, ProductMessages.ProductsListed));
        }
Ejemplo n.º 2
0
 public async Task <List <Product> > GetAllAsync()
 {
     return(await Task.Run(() => {
         Console.WriteLine($"Async Thread : {System.Threading.Thread.CurrentThread.ManagedThreadId}");
         return _productDal.GetAllAsync();
     }));
 }
Ejemplo n.º 3
0
 public async Task <List <Product> > GetAllByActiveAsync()
 {
     return(await _productDal.GetAllAsync(x => x.IsDelete == true && x.IsActive == true, x => x.Id));
 }
Ejemplo n.º 4
0
 public async Task <List <Product> > GetAllAsync()
 {
     return(await _appProductDal.GetAllAsync());
 }
Ejemplo n.º 5
0
        public async Task <List <Product> > GetAllAsync(Expression <Func <Product, bool> > filter = null)
        {
            var cancelToken = new CancellationTokenSource();

            return(await _productDal.GetAllAsync(cancelToken.Token, filter));
        }
Ejemplo n.º 6
0
 public Task <List <Product> > GetAllAsync()
 {
     return(_productDal.GetAllAsync());
 }
Ejemplo n.º 7
0
 public async Task <IDataResult <List <Product> > > GetAll()
 {
     return(new SuccessDataResult <List <Product> >(await _productDal.GetAllAsync()));
 }
        public async Task <IDataResult <List <Product> > > GetAllProductsAsync()
        {
            var data = await _productDal.GetAllAsync();

            return(new SuccessDataResult <List <Product> >(data.ToList()));
        }