Пример #1
0
        public void GetTheData(FacDbType db)
        {
            IDbObject database = _factory.Create(db);

            database.OpenDatabase();
            Console.WriteLine(database.GetData());
            database.CloseDatabase();
        }
Пример #2
0
        public IDbObject Create(FacDbType type)
        {
            switch (type)
            {
            case FacDbType.Oracle:
                return(new OracleDbObject());

            case FacDbType.SqlServer:
                return(new SqlServerDbObject());

            case FacDbType.PostGres:
                return(new PostGresDbObject());

            default:
                throw new Exception("Unknown Database Type!");
            }
        }
Пример #3
0
        private static void RunDatabaseScenario(FacDbType db)
        {
            FacClient client = new FacClient(new MyMyDbFactory());

            client.GetTheData(db);
        }