Example #1
0
        public Category MapCategoryInputToExistingEntity(CategoryInput categoryInput, Category categoryEntityToUpdate)
        {
            categoryEntityToUpdate.Description = categoryInput.Description;
            categoryEntityToUpdate.Name = categoryInput.Name;
            categoryEntityToUpdate.UrlSlug = categoryInput.UrlSlug;

            return categoryEntityToUpdate;
        }
Example #2
0
 public CategoryInput MapEntityToCategoryInput(Category category)
 {
     return new CategoryInput
                {
                    CategoryId = category.CategoryId,
                    Description = category.Description,
                    Name = category.Name,
                    UrlSlug = category.UrlSlug
                };
 }
 public static MvcHtmlString CategoryLink(this HtmlHelper helper, Category category)
 {
     return helper.ActionLink(category.Name, "Category", "Blog",
         new
             {
                 category = category.UrlSlug
             },
         new
             {
                 title = String.Format("See all posts in {0}", category.Name)
             });
 }