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(); }
static void Main(string[] args) { var dbMigrator = new DbMigrator(new Logger()); var logger = new Logger(); var installer = new Installer(logger); dbMigrator.Migrate(); installer.Install(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
static void Main(string[] args) { var inst = new Installer(new Logger()); inst.Install(); }