viciproject/coolstorage — pull request #12 by simongh (2013-07-31 12:36:02+00:00)
Title: Added IOC aware service locator

I've added some code to allow CoolStorage to play with ioc containers.

Firstly there is a new `CSServiceLocator` class that creates instances of objects. It can be configured with a provider that implements `ICSServiceLocator` - this is how you wire your framework of choice in.

`CSDatabase` has been changed in 2 places. The first is in `RunQuery`. The service locator now creates the instance.

The 2nd place was more tricky. The reflection code now checks the constructor on the abstract base class & ensures a similar constructor is created on the type it creates. This new type can then be passed to the IOC framework to instantiate & inject any dependencies.

It appears to work, however I've not tested it across all the platforms that CoolStorage supports. It will work, the same as normal, without an IOC framework being configured.

Let me know if anything is not clear, or needs extra work.