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)); }
public IActionResult Listar() { var posts = Mapper.Map <IEnumerable <Posts>, IEnumerable <PostsViewModel> >(postsServices.BuscaPorTudo()); return(View(posts)); }