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