public void GetTheData(FacDbType db) { IDbObject database = _factory.Create(db); database.OpenDatabase(); Console.WriteLine(database.GetData()); database.CloseDatabase(); }
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!"); } }
private static void RunDatabaseScenario(FacDbType db) { FacClient client = new FacClient(new MyMyDbFactory()); client.GetTheData(db); }