# LINQ Filtering

Create a list(List\<int> in the example below) and populate it in order to use said list as an example. Then apply two queries, one to filter the numbers bigger than 5 and the second one to order the items in a descending order, converting the result to a list.

```csharp
List<int> list = new List<int>();
list.Add(1);
list.Add(2);
list.Add(-15);
list.Add(21);
list.Add(5);
list.Add(9);
list.Add(123);

var integerList = list.Where(x => x > 5);
var integerList = list.OrderByDescending(x => x).ToList();
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tailent.com/scripting-utility-classes/common-scripts-repository/c-scripts-repository/linq-filtering.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
