Exemple #1
0
        public ICollection <Product> GetProductsByCategory(int categoryId)
        {
            List <BLL.Models.Product> list = new List <BLL.Models.Product>();

            foreach (var item in _dal.GetProductsByCategory(categoryId))
            {
                var product = new BLL.Models.Product
                {
                    Id             = item.Id,
                    CategoryId     = item.CategoryId,
                    ManufacturerId = item.ManufacturerId,
                    Name           = item.Name,
                    Description    = item.Description,
                    Price          = item.Price,
                    Keywords       = item.Keywords,
                    Quantity       = item.Quantity
                };
                list.Add(product);
            }
            return(list);
        }