# Where

**Where** filtrlash kalit so’zi if shart operatori kabi ishlaydi. U bilan filtirlash jarayonida shart beriladi va bizga shartga to’g’ri keladigan varinatlarni [qaytaradi ](https://docs.dot-net.uz/c-.net/linq/filterlash-operatorlari). Ushbu filtrlash uslubi shart operatori kabi ishlagani uchun unda [mantiqiy operatorlar](https://docs.dot-net.uz/c-.net/basic/starter/operatorlar) dan ham foydalanishimiz mumkin. Method syntax:

```csharp
class Program
{
    static void Main(string[] args)
    {
        List<int> numbers = new List<int>() { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
        var MethodSyntax = numbers.Where(x => x > 4 && x < 7).ToList();
        foreach (var item in MethodSyntax)
        {
           Console.WriteLine(item);
        }
        // Output: 5, 6
    }
}
```

Query syntax

```csharp
class Program
{
    static void Main(string[] args)
    {
        List<int> numbers = new List<int>() { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
            var MethodSyntax = from num in numbers
                               where num > 4 && num < 7
                               select num;
        foreach (var item in MethodSyntax)
        {
           Console.WriteLine(item);
        }
        // Output: 5, 6
    }
}
```


---

# 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.dot-net.uz/c-.net/linq/where.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.
