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) })); }
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) })); }
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) })); }