I have two different databases I am accessing within my program. Each database has a different schema and thus a different set of generated classes. Database A should use the default connection in the entity spaces configuration and Database B should use the second connection defined in the entity spaces configuration. It seems that the only way to accomplish this is to continually set the Connection.Name property after instantiating an entity, collection or query class. It would be nice if the default connection for a entity, collection or query class could be set based on namespace in the configuration. For example, the classes used for database B are in namespace ABC and the classes for database A are in namespace XYZ and via configuration I specifiy <namespacerule default="connection1" namespace="ABC"/><namespacerule default="connection2" namespace="XYZ"/>.
My current workaround is to use the QueryBase, CollectionBase and EntityBase and implement the defaulting within the default constructor for example:
Code:
public QueryBase()
{
es.Connection.Name = GetDefaultConnection(this.GetType().Namespace)
}