예제 #1
0
        public IActionResult Index()
        {
            var posts = Mapper.Map <IEnumerable <Posts>, IEnumerable <PostsViewModel> >(postsSevices.BuscaPorTudo());

            posts.Where(p => p.PreviaTexto.Length > 200).ToList().ForEach(p => p.PreviaTexto = p.PreviaTexto.Substring(0, 200) + " ....");
            return(View(posts));
        }
예제 #2
0
        public IActionResult Listar()
        {
            var posts = Mapper.Map <IEnumerable <Posts>, IEnumerable <PostsViewModel> >(postsServices.BuscaPorTudo());

            return(View(posts));
        }