/* Client */ static void Main(string[] args) { /* Aqui vamos estanciar a nossa Factory */ //DbFactory db = new SqlFactory(); DbFactory db = new MongoFactory(); var con = db.CreateConnection(); con.Open(); var cmd = db.CreateCommand(); cmd.Execute(); Console.ReadLine(); }
static void Main(string[] args) { DBFactory db = new SQLFactory(); var con = db.CreateConnection(); con.Open(); var cmd = db.CreateCommand(); cmd.Execute(); db = new MongoFactory(); con = db.CreateConnection(); con.Open(); cmd = db.CreateCommand(); cmd.Execute(); }