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(); 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); } }
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); } }
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); } }
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); } }