Exemplo n.º 1
0
        static void Main(string[] args)
        {
            var dbMigrator = new DbMigrator(new Logger(), ("DB_Log_" + DateTime.Now));
            var installer = new Installer(new Logger(), ("Installation_Log_" + DateTime.Now));

            dbMigrator.Migrate();

            installer.Install();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            var dbMigrator = new DbMigrator(new Logger());

            var logger    = new Logger();
            var installer = new Installer(logger);

            dbMigrator.Migrate();

            installer.Install();
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            // Two ways to inisialise the logger
            // One to initialise straight in the parameters
            var dbMigrator = new DbMigrator(new Logger());

            // One to create a new variable and pass it in the parameters
            var logger    = new Logger();
            var installer = new Installer(logger);

            dbMigrator.Migrate();
            installer.Install();
        }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            // to pass a class type to another class: initialize like this OR set an instance to a variable (var something = new Something())
            var dbMigrator = new DbMigrator(new Logger());

            var logger    = new Logger();
            var installer = new Installer(logger);

            // the take away here is that we are able to compose classes (migrator and installer) that can take in a logger
            // instance, and use its' logging function to log something, all within the Migrate and Install methods
            dbMigrator.Migrate();
            installer.Install();
        }
Exemplo n.º 5
0
        static void Main(string[] args)
        {
            /// Write one method use that in different places!!! like you know

            var DbMigrator = new DBMIgrator(new Logger());

            DbMigrator.Migrate();

            var logger    = new Logger();
            var installer = new Installer(logger);

            installer.Install();
        }
Exemplo n.º 6
0
        static void Main(string[] args)
        {
            //create a object and pass it an object
            var dbMigrator = new DbMigrator(new Logger());

            //create a variable and pass it to object
            var logged    = new Logger();
            var installer = new Installer(logged);

            dbMigrator.Migrate();
            installer.Install();
            Console.WriteLine();
        }
Exemplo n.º 7
0
        public static void Main(string[] args)
        {
            // Console.WriteLine("Hello World!");

            var dbMigrator = new DbMigrator(new Logger());              //  Technique 1 We pass a new object

            var logger      = new Logger();
            var myInstaller = new Installer(logger);

            dbMigrator.Migrate();

            myInstaller.Install();
        }
Exemplo n.º 8
0
        static void Main(string[] args)
        {
            var dbMigrator = new DbMigrator(new Logger());

            var logger    = new Logger();
            var installer = new Installer(logger);

            dbMigrator.Migration();

            installer.Install();

            Console.ReadKey();
        }
Exemplo n.º 9
0
        static void Main(string[] args)
        {
            // Theres two ways we can pass a logger object
            // Method 1
            var dbMigrator = new DbMigrator(new Logger());

            // Method 2
            var logger    = new Logger();
            var installer = new Installer(logger);

            dbMigrator.Migrate();

            installer.Install();
        }
Exemplo n.º 10
0
        static void Main(string[] args)
        {
            var dbmagrated = new DbMigrator(new Logger());

            dbmagrated.Migrate();

            /*  ou
             * var install = new Installer(new Logger());
             * install.Install(); */

            var logger = new Logger();
            var insta  = new Installer(logger);

            insta.Install();
            System.Console.ReadKey();
        }
Exemplo n.º 11
0
        static void Main(string[] args)
        {
            // using a functionality of a seperate class
            // in two different other class using composition
            var logger = new Logger();

            var migrator = new DbMigrator(logger);

            migrator.Migrate();

            var installer = new Installer(logger);

            installer.Install();


            Console.ReadKey();
        }
Exemplo n.º 12
0
        static void Main(string[] args)
        {
            var inst = new Installer(new Logger());

            inst.Install();
        }