Пример #1
0
        static void Main(string[] args)
        {
            Product product1 = new Product();

            product1.Id           = 1;
            product1.CategoryId   = 2;
            product1.ProductName  = "Table";
            product1.UnitPrice    = 500;
            product1.UnitsInStock = 3;

            Product product2 = new Product()
            {
                Id           = 2, CategoryId = 5,
                UnitsInStock = 5, ProductName = "Pen", UnitPrice = 35
            };

            //PascalCase   //camelCase
            ProductManager productManager = new ProductManager();

            productManager.Add(product1);
            productManager.Update(product1);

            productManager.Addition2(3, 6);

            //return sayesinde Addition() metotdun icersindeki degeri dondurerek main icerisinde tekrar kullanabiliriz.
            int additionResult = productManager.Addition(3, 6);    //Metot icersindeki aldigimiz return degerini kullanmak istersek boyle yapariz.

            Console.WriteLine(additionResult * 2);

            //int,double,bool.... -> Value Type
            //arrays,classes,abstract classes,interface... -> Reference Type
            Console.ReadLine();
        }
Пример #2
0
        static void Main(string[] args)
        {
            Product product1 = new Product();

            product1.ID          = 1;
            product1.CategoryID  = 2;
            product1.ProductName = "Masa";
            product1.UnitPrice   = 500;
            product1.UnitInStock = 3;

            Product product2 = new Product {
                ID = 2, CategoryID = 5, UnitInStock = 5, ProductName = "Kalem", UnitPrice = 35
            };
            //PascalCase(ilk harfler buyuk) //camelCase (ilk harf kucuk diger kelimenin ilk harfi  buyuk
            ProductManager productManager = new ProductManager();

            productManager.Add(product1);
            Console.WriteLine(product1.ProductName);

            productManager.Addition2(3, 6);

            int additionTotal = productManager.Addition(3, 6);

            Console.WriteLine(additionTotal * 2);
        }