Example #1
0
        public CategoryResponse Edit(Category category)
        {
            var context = new PersonalBlogEntities();

            if (context.Categories.Contains(category))
            {
                var response = new CategoryResponse();
                response.Success = false;
                response.Message = $"The category {category.CategoryName} is already in the database.";
                return(response);
            }
            else
            {
                return(repo.Edit(category));
            }
        }