コード例 #1
0
        static void Main(string[] args)
        {
            EfProductDal efProductDal = new EfProductDal();

            foreach (var product in efProductDal.GetAll())
            {
                Console.WriteLine(product.Name);
            }
        }
コード例 #2
0
        static void Main(string[] args)
        {
            EfProductDal efProductDal = new EfProductDal();
            Product      product1     = new Product {
                CategoryId = 1, BrandId = 1,
                Name       = "Su", Price = 2, CreateDate = DateTime.Now, Code = "WTR01", Active = true
            };

            efProductDal.Add(product1);
            foreach (var product in efProductDal.GetAll())
            {
                Console.WriteLine(product.Name);
            }
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: nazanbahar/BootCamp
        static void Main(string[] args)
        {
            EfProductDal efProductDal = new EfProductDal();
            //added
            Product product1 = new Product {
                CategoryId = 1,
                BrandId    = 1,
                Name       = "Su",
                Price      = 2,
                CreateDate = DateTime.UtcNow,
                Code       = "WTR01",
                Active     = true,
            };

            //listed
            foreach (var product in efProductDal.GetAll(p => p.CategoryId == 1))
            {
                Console.WriteLine(product.Name);
            }
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: UurZer/ETrade
        static void Main(string[] args)
        {
            EfProductDal efProductDal = new EfProductDal();

            efProductDal.Add(new Product
            {
                CategoryId = 2,
                Name       = "Su",
                Active     = true,
                BrandId    = 1,
                Code       = "WTR01",
                CreateDate = DateTime.Now,
                Price      = 2
            });

            foreach (var item in efProductDal.GetAll())
            {
                Console.WriteLine(item.Name);
            }
        }
コード例 #5
0
        static void Main(string[] args)
        {
            EfProductDal efProduckDal = new EfProductDal();

            Product produck = new Product
            {
                CategoryId = 1,
                BrandId    = 1,
                Name       = "Kahve",
                Price      = 3,
                CreateDate = DateTime.Now,
                Code       = "SMT",
                Active     = true
            };

            efProduckDal.Add(produck);

            foreach (var product in efProduckDal.GetAll())  // && ve  // p => p.CategoryId == 1   filtre
            {
                Console.WriteLine(product.Name);
            }
        }
コード例 #6
0
        static void Main(string[] args)
        {
            EfProductDal efProductDal = new EfProductDal();

            Product product1 = new Product
            {
                CategoryId = 5,  //2'ye ekleme yapma, farklı id'de tabloya kategori girişi yap.
                BrandId    = 1,
                Name       = "Su",
                Price      = 2,
                CreateDate = DateTime.Now,
                Code       = "WTR01",
                Active     = true
            };

            efProductDal.Add(product1);

            foreach (var product in efProductDal.GetAll())
            {
                Console.WriteLine(product.Name);
            }
        }
コード例 #7
0
ファイル: Program.cs プロジェクト: Kucukdogru/ETrade
        static void Main(string[] args)
        {
            EfProductDal efProductDal = new EfProductDal();

            Product product1 = new Product
            {
                CategoryId = 1,
                BrandId    = 1,
                Name       = "Su",
                Price      = 2,
                CreateDate = DateTime.Now,
                Code       = "WTR01",
                Active     = true
            };

            //efProductDal.Add(product1);

            //Veri tabanına yazdığımız filtreye göre
            foreach (var product in efProductDal.GetAll(p => p.CategoryId == 1))
            {
                Console.WriteLine(product.Name);
            }
        }