I would like to fetch X number of, lets say, news articles. However, I would like to skip certain, choosen, news articles by ID.
For instance. I want to take 10 news articles that are not in the array with ID's of news articles to skip. How can I query this? The ID's may be an array length from 0 to X.
I have trouble explaining this so please, tell me if I need to explain it further.
Here's an example of how you could do it using a published content query. Assume "articles" is a query that brings back all your articles and existingIds is an array of Ids you don't want to include in filtered list.
var articles = Model.Content.Children();
var existingIds = new int[] { 1234, 1235, 1236, 1238, 1239 };
var filteredArticles = articles.Where(p => !existingIds.Contains(p.Id)).Take(10);
Querying: Have dynamic number of parameters?
Hello everybody,
I would like to fetch X number of, lets say, news articles. However, I would like to skip certain, choosen, news articles by ID.
For instance. I want to take 10 news articles that are not in the array with ID's of news articles to skip. How can I query this? The ID's may be an array length from 0 to X.
I have trouble explaining this so please, tell me if I need to explain it further.
Here's an example of how you could do it using a published content query. Assume "articles" is a query that brings back all your articles and existingIds is an array of Ids you don't want to include in filtered list.
You're the boss, thx :)
is working on a reply...