Example #1
0
        public CategoryContentViewModel AddCategory(string title, string description)
        {
            var slug     = _slugService.CreateSlugFromPostTitle(title);
            var category = _dataProvider.AddCategory(title, description, slug);

            return(new CategoryContentViewModel
            {
                Id = category.Id,
                Title = category.Title,
                NumPosts = category.PostCategories.Count,
                Description = category.Description,
                Slug = category.Slug
            });
        }