Beispiel #1
0
        public void RemoveCatagoryFromBlogPost(int blogId)
        {
            BlogPost toSwapFor = blogPosts.Where(b => b.BlogPostId == blogId).FirstOrDefault();
            //toSwapFor.CatagoryId = null;
            InMemoryBlogPostRepo inMemoryBlogPostRepo = new InMemoryBlogPostRepo();

            inMemoryBlogPostRepo.UpdateBlogPost(toSwapFor);
        }
Beispiel #2
0
        public void AddCatagoryToBlogPost(int blogPostId, int categoryId)
        {
            BlogPost toSwapFor = blogPosts.Where(b => b.BlogPostId == blogPostId).FirstOrDefault();

            toSwapFor.CatagoryId = categoryId;
            InMemoryBlogPostRepo inMemoryBlogPostRepo = new InMemoryBlogPostRepo();

            inMemoryBlogPostRepo.UpdateBlogPost(toSwapFor);
        }