How can I make FilterDefinitionBuilder like x => x.Keywords.Equals(category)

this code is Eq Select :
var condition = Builders.Filter.Eq(p => p.Author, category);

            var fields = Builders<ResItem>.Projection.Include(p => p.MongoId)
                        .Include(p => p.Title)
                        .Include(p => p.Category)
                        .Include(p => p.UsedStates)
                        .Include(p => p.PublishDate)
                        .Include(p => p.CreateDate)
                        ;
         
            var results = TArticleContent.Find(condition).Project<ResItem>(fields).Skip((pageIndex - 1) * pageSize).Limit(pageSize);

Now i need the code like
(x => x.Keywords.Equals(category)

like
var items = TArticleContent.PageList(x => x.Keywords.Equals(category), a => a.Desc(b => b.PublishDate), pageIndex, pageSize);

Thanks very much…

:grinning:I Haved do it This is solution:

    var fields = Builders<ResItem>.Projection.Include(p => p.MongoId)
            .Include(p => p.Title)
            .Include(p => p.Category)
            .Include(p => p.UsedStates)
            .Include(p => p.PublishDate)
            .Include(p => p.CreateDate)
            ;

var items = TArticleContent.Find(x => x.Keywords.Equals(category)).Project(fields).Skip((pageIndex - 1) * pageSize).Limit(pageSize).ToList();
var Count = TArticleContent.CountDocuments(x => x.Keywords.Equals(category));

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.