static void Main(string[] args) { Console.InputEncoding = Encoding.Unicode; Console.OutputEncoding = Encoding.Unicode; ProductG p = new ProductG(); ProductT t = new ProductT(); //for(int i = 0;i<5;i++) //{ // t.AddProduct(); //} //p.ShowPRoduct(); //p.WriteFile(); //p.ReadFile(); for (int i = 0; i < 5; i++) { p.AddProduct(); } t.AddProduct(); t.ShowPRoduct(); t.WriteDDR(); Console.ReadLine(); AppKernel = new StandardKernel(new UseG()); var useG = AppKernel.Get <ProductG>(); useG.AddProduct(); Console.ReadLine(); }
public void AddProduct() { var fruit = new[] { "appleT", "bananaT", "orangeT", "strawberryT", "kiwiT", "potatoT", "grapeT", "pineappleT" }; var testProductT = new Faker <ProductT>("uk") .CustomInstantiator(f => new ProductT(userIds++)) .RuleFor(u => u.Name, f => f.PickRandom(fruit)) .RuleFor(u => u.Country, f => f.Address.Country()); ProductT ProductItem = testProductT.Generate(); t.Add(ProductItem); }
public void Delete(ProductT ob) { t.Remove(ob); }