static void Main(string[] args)
        {
            Singleton singleton = new Singleton();
            singleton.ConsoleWriteLineString("Singleton DesoignPatterns console writeline.");

            IFactoryMethod ingrediens = FactoryMethod.CookScrambledEggs(IngiedientEnum.Ham);
            ingrediens.Ingredient();
            IFactoryMethod ingrediens2 = FactoryMethod.CookScrambledEggs(IngiedientEnum.Onion);
            ingrediens2.Ingredient();
            IFactoryMethod ingrediens3 = FactoryMethod.CookScrambledEggs(IngiedientEnum.Eggs);
            ingrediens3.Ingredient();
            IFactoryMethod ingrediens4 = FactoryMethod.CookScrambledEggs(IngiedientEnum.Salt);
            ingrediens4.Ingredient();

            //Builder and repository(abstract class instead of interface )
            Client mClient = new Client();
            mClient.CreateProduct();

            //Observer
            ConcreteItem concreteItem = new ConcreteItem();

            ConcreateObserver cObserver1=new ConcreateObserver("Item 1");
            ConcreateObserver cObserver2=new ConcreateObserver("Item 2");

            concreteItem.Attach(cObserver1);
            concreteItem.Attach(cObserver2);
            concreteItem.ChangeItemNumber(2);
            concreteItem.DeAttach(cObserver2);
            concreteItem.ChangeItemNumber(5);

            //Repository with interface

            var repository = new RepositoryUse();
            repository.Use();

            Console.ReadKey();
        }
 public void DeAttach(ConcreateObserver item)
 {
     observerList.Remove(item);
 }
 public void Attach(ConcreateObserver item)
 {
     observerList.Add(item);
 }