示例#1
0
        private static void AddProduct()
        {
            EfProductDal efProductDal = new EfProductDal();

            efProductDal.Add(new Product()
            {
                CategoryId = 1, ProductName = "Ayakkabı", UnitPrice = 150, UnitsInStock = 5
            });
        }
        static void Main(string[] args)
        {
            EfProductDal efProductDal = new EfProductDal();

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

            //foreach (var product in efProductDal.GetAll())
            //{
            //    Console.WriteLine(product.Name);
            //}
        }
示例#4
0
        private static void ProductTest()
        {
            int            counter        = 1;
            EfProductDal   efProductDal   = new EfProductDal();
            ProductManager productManager = new ProductManager(efProductDal);
            var            result         = productManager.GetProductDetails();

            if (result.Success)
            {
                foreach (var product in result.Data)
                {
                    Console.WriteLine(product.ProductName + "/" + product.CategoryName);
                }
            }
            else
            {
                Console.WriteLine(result.Message);
            }
        }
示例#5
0
        static void Main(string[] args)
        {
            EfProductDal efProductDal = new EfProductDal();

            Product product1 = new Product {
                CategoryId = 2,
                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);
            }
        }
示例#6
0
        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);
            }
        }
示例#7
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);
            }
        }
示例#8
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);
            }
        }
示例#9
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);
            }
        }
示例#10
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);

            //Veri tabanına yazdığımız filtreye göre
            foreach (var product in efProductDal.GetAll(p => p.CategoryId == 1))
            {
                Console.WriteLine(product.Name);
            }
        }
示例#11
0
 public ProductManager(EfProductDal efProductDal)
 {
     this.efProductDal = efProductDal;
 }