コード例 #1
0
 public async Task <IEnumerable <Artigo> > ObterUltimasPublicacoes(BlogEnum blog)
 {
     return(await FindAll()
            .Where(filtro => filtro.AQualBlogPertence.Equals(blog.ToString()))
            .Take(5)
            .ToListAsync());
 }
コード例 #2
0
 public async Task <IEnumerable <Artigo> > ObterTodos(int page, int quantity, BlogEnum blog)
 {
     return(await FindAll()
            .Where(filtro => filtro.AQualBlogPertence.Equals(blog.ToString()))
            .OrderByDescending(filtro => filtro.DataPublicacao)
            .Skip((page - 1) * quantity)
            .Take(quantity)
            .ToListAsync());
 }