> For the complete documentation index, see [llms.txt](https://cnahmet.gitbook.io/asp-net-notlarim/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cnahmet.gitbook.io/asp-net-notlarim/orm-entity-framework-core/veri-tabanina-kayit-ekleme.md).

# Veri Tabanına Kayıt Ekleme

#### Tek bir kayıt yapma

```
        static void AddProduct()
        {
            using(var db = new ShopContext())
            {                
                var p = new Product{Name="Iphone 12", Price=15000};
                db.Products.Add(p);
                db.SaveChanges();
            }
        }
```

#### Birden çok kayıt ekleme

```
        static void AddProducts()
        {
            using(var db = new ShopContext())
            {
                var products = new List<Product>
                {
                    new Product{Name="Samsung S10", Price=10000},
                    new Product{Name="Huawei Mate 10 Lite", Price=3500},
                    new Product{Name="Nokia Lumia 520", Price=800},
                    new Product{Name="Xiaomi RedMi S2", Price=2000},
                };

                db.Products.AddRange(products);
                db.SaveChanges();
            }
        }
```
