I have a project that uses SS (Great framework!!). It is a Rest API. I reference an other project (I am doing this in VS2012) in the same solution that provides an interface. I also have a 3rd project in the same solution that implements this interface. Lets call these projects:
WebAPI
Interfaces
Engine
WebAPI references Interfaces and Engine. Engine references Interfaces
All is well so far.
I use IOC in appHost (of WebAPI) to register the Interface of the Engine and this works as well.
My issue is that my Engine needs to access the Ormlite database. I have added a reference of ServiceStatck.OrmLight.Mysql to the Engine but the reference is null when referenced in the Engine constructor.
public Engine()
{
using (var db = DbConnectionFactory.OpenDbConnection())
{
//do db operations
}
}
I can access find the database from Webapi. How do I inform engine of the database? I seem to be lost amongst the layers.
I hope this is clear (considering).