Esempio n. 1
0
        public async Task <List <User> > GetAll()
        {
            var result = await ItemSet.AsNoTracking().ToListAsync();

            result.ForEach(p => p.Password = null);
            return(result);
        }
Esempio n. 2
0
        public async Task <MyCart> GetAll(long customerId)
        {
            var products = await ItemSet.AsNoTracking().Where(p => p.UserId == customerId).Include(p => p.Product).ToListAsync();

            var myCart = new MyCart()
            {
                Products = products.Select(p => p.Product).ToList(),
            };

            return(myCart);
        }