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); } }
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); //} }
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); } }
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); } }
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); } }
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); } }
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); } }
public ProductManager(EfProductDal efProductDal) { this.efProductDal = efProductDal; }