Exemplo n.º 1
0
        // GET: Project
        public IEnumerable <Categories> Get()
        {
            using (DreamFountainDBEntities entities = new DreamFountainDBEntities())
            {
                var categories = entities.Categories.ToList();

                foreach (var item in categories)
                {
                    entities.Entry(item).State = EntityState.Detached;
                }

                return(categories);
            }
        }
Exemplo n.º 2
0
        // GET: Project
        public IEnumerable <SubCategories> Get()
        {
            using (DreamFountainDBEntities entities = new DreamFountainDBEntities())
            {
                //return entities.SubCategories.ToList();


                var subcategories = entities.SubCategories.ToList();

                foreach (var item in subcategories)
                {
                    entities.Entry(item).State = EntityState.Detached;
                }

                return(subcategories);
            }
        }