Exemple #1
0
        public MultiBlogPostCustom DeleteBlogPost(string slug)
        {
            var findbySlug = con.BlogPosts.Where(x => x.Slug == slug).FirstOrDefault();

            if (findbySlug != null)
            {
                con.Remove(findbySlug);
                con.SaveChanges();
            }
            //not specified what this should return, so I've chosen to return list of all posts by post date
            return(GetBlogPostList());
        }