Example #1
0
 public IEnumerable <ProductModel> GetAllProductModels()
 {
     return(GetAll().Select(
                c => new ProductModel()
     {
         Name = c.Name,
         ProductID = c.ProductID,
         Picture = c.Picture.LoadImage(),
         PriceOnOrder = c.UnitOnOrder,
         UnitPrice = c.UnitPrice,
         Quantity = SqlSupport.GetQuantityByProductId(c.ProductID)
     }));
 }
Example #2
0
        public IEnumerable <ProductModel> GetProductModelsFilter(Func <Product, bool> predicate)
        {
            var ds = GetFilter(predicate);

            return(ds.Select(
                       c => new ProductModel()
            {
                Name = c.Name,
                ProductID = c.ProductID,
                Picture = c.Picture.LoadImage(),
                PriceOnOrder = c.UnitOnOrder,
                UnitPrice = c.UnitPrice,
                Quantity = SqlSupport.GetQuantityByProductId(c.ProductID)
            }));
        }
Example #3
0
        public async Task <IEnumerable <ProductModel> > GetAllProductModelsAsync()
        {
            var ds = await GetAllAsync();

            return(ds.Select(
                       c => new ProductModel()
            {
                Name = c.Name,
                ProductID = c.ProductID,
                Picture = c.Picture.LoadImage(),
                PriceOnOrder = c.UnitOnOrder,
                UnitPrice = c.UnitPrice,
                Quantity = SqlSupport.GetQuantityByProductId(c.ProductID)
            }));
        }