예제 #1
0
        public List <Category> AllCategory()
        {
            List <Category> categories   = new List <Category>();
            var             listCategory = _connectDB.AllCategory();

            foreach (DataRow dr in listCategory.Tables[0].Rows)
            {
                Category category = new Category();
                category.id   = Convert.ToInt32(dr["id"]);
                category.name = dr["name"].ToString();
                categories.Add(category);
            }
            return(categories);
        }