예제 #1
0
        /* 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();
        }
예제 #2
0
        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();
        }