public static void InitDatabaseRoutes(this Funq.Container container, IServiceRoutes routes) { if (container.InitMongoDB()) { routes.Add <MongoDBDbRequest>("/mongodb/db", "GET"); routes.Add <MongoDBQueriesRequest>("/mongodb/queries/{queries}", "GET"); routes.Add <MongoDBFortunesRequest>("/mongodb/fortunes", "GET"); routes.Add <MongoDBUpdatesRequest>("/mongodb/updates/{queries}", "GET"); routes.Add <MongoDBCachedDbRequest>("/mongodb/cached/db", "GET"); } if (container.InitMySQL()) { routes.Add <MySqlDbRequest>("/mysql/db", "GET"); routes.Add <MySqlQueriesRequest>("/mysql/queries/{queries}", "GET"); routes.Add <MySqlFortunesRequest>("/mysql/fortunes", "GET"); routes.Add <MySqlUpdatesRequest>("/mysql/updates/{queries}", "GET"); routes.Add <MySqlCachedDbRequest>("/mysql/cached/db", "GET"); } if (container.InitPostgreSQL()) { routes.Add <PostgreSqlDbRequest>("/postgresql/db", "GET"); routes.Add <PostgreSqlQueriesRequest>("/postgresql/queries/{queries}", "GET"); routes.Add <PostgreSqlFortunesRequest>("/postgresql/fortunes", "GET"); routes.Add <PostgreSqlUpdatesRequest>("/postgresql/updates/{queries}", "GET"); routes.Add <PostgreSqlCachedDbRequest>("/postgresql/cached/db", "GET"); } if (container.InitSQLServer()) { routes.Add <SqlServerDbRequest>("/sqlserver/db", "GET"); routes.Add <SqlServerQueriesRequest>("/sqlserver/queries/{queries}", "GET"); routes.Add <SqlServerFortunesRequest>("/sqlserver/fortunes", "GET"); routes.Add <SqlServerUpdatesRequest>("/sqlserver/updates/{queries}", "GET"); routes.Add <SqlServerCachedDbRequest>("/sqlserver/cached/db", "GET"); } }