Exemplo n.º 1
0
        public static TagIndexViewModel ConvertTagToTagIndexViewModel(Tag tag)
        {
            TagIndexViewModel tagIndexViewModel = new TagIndexViewModel();

            tagIndexViewModel.Id      = tag.Id;
            tagIndexViewModel.Name    = tag.Name;
            tagIndexViewModel.SlugUrl = tag.SlugUrl;
            tagIndexViewModel.Posts   = ClassPostConverter.ConvertListPostsToListPostIndexViewModel(tag.Posts.ToList());


            return(tagIndexViewModel);
        }
Exemplo n.º 2
0
        public static CategoryIndexViewModel ConvertCategoryToCategoryIndexViewModel(Category category)
        {
            CategoryIndexViewModel categoryIndexViewModel = new CategoryIndexViewModel();

            categoryIndexViewModel.Id      = category.Id;
            categoryIndexViewModel.Name    = category.Name;
            categoryIndexViewModel.SlugUrl = category.SlugUrl;
            categoryIndexViewModel.Posts   = ClassPostConverter.ConvertListPostsToListPostIndexViewModel(category.Posts.ToList());


            return(categoryIndexViewModel);
        }