Exemplo n.º 1
0
 //D-Delete Categories
 public void deleteCategory(Category category)
 {
     this.Categories.Remove(category);
     this.SaveChanges();
 }
Exemplo n.º 2
0
        //I put the CRUD in here, and identified it below. This way, I was able to save the changes in a cleaner way
        //then I did in the previous Blog/Post. I repeated it in the Switch on Blog/Post. This time I tried to clean
        //up my code so I didn't do that


        //C-Create Categories
        public void addCategory(Category category)
        {
            this.Categories.Add(category);
            this.SaveChanges();
        }