# Veri Tabanından Kayıt Çağırma

#### Tek bir kayıt çağırma

```
        static void GetProduct(int id) 
        {
            using(var context = new ShopContext())
            {
                var product = context
                .Products
                .Where(p => p.Id ==id)
                .FirstOrDefault();
                Console.WriteLine($"{product.Id}. Telefon: {product.Name} Fiyatı {product.Price}");

            }
        }
```

#### Birden fazla kayıt çağırma

```
        static void GetAllProducts()
        {
            using(var context = new ShopContext())
            {
                // Koşulsuz tüm kayıtları getirir.
                var products = context.Products.ToList();
                foreach (var p in products)
                {
                    Console.WriteLine($"{p.Id}. Telefon: {p.Name} Fiyatı {p.Price}");
                }
                

                // Seçili kolonları gösterme
                var products = context
                .Products
                .Select(p => new {
                    p.Name
                })
                .ToList();
                foreach (var p in products)
                {
                    Console.WriteLine($"Telefon: {p.Name}");
                }
                
            }
        }
```


---

# 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://cnahmet.gitbook.io/asp-net-notlarim/orm-entity-framework-core/veri-tabanindan-kayit-cagirma.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.
