tmsmith/Dapper-Extensions — pull request #77 by garyhuntddn (2014-02-03 22:26:45+00:00)
Title: Support database identifier within table name

As I'm sure you are aware it is possible to identify both the database and schema within the table identifier in a number of databases technologies (e.g. SQL, Oracle etc)

The merge adds DatabaseName to the IClassMapper interface to support this process.

I've updated the core code to support this, including the base ClassMapper implementation and associated tests.

As this property is added to the IClassMapper interface it does break that interface so if you'd prefer we could refactor into an IClassMapperWithDatabase interface and test for that internally. It all depends on whether you think a large number of people have implemented instances of IClassMapper and whether adding a single property to support the interface is enough of a deterrent.

Personally I use this with a DataAnnotationsClassMapper which reads my annotated DTO classes and creates maps accordingly. We have a number of separate databases for tasks such as audit and profile that are kept away from the core database and it's not ideal having to call IDBConnection.ChangeDatabase() prior to calls to the DapperExtensions.

cheers,

Gary