コード例 #1
0
        ICollection <Product> IService1.GetProductsByCatecory(string categoryId)
        {
            List <Product> list = new List <Product>();

            foreach (var item in _bll.GetProductsByCategory(Int32.Parse(categoryId)))
            {
                Product product = new 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.ToArray());
        }