I'm trying to enable SqlCacheDependency through my StructureMap IoC, I'm using LinqToSql I have the code done to take care of the Linq Caching but not quite sure how to go about setting up the SqlCacheDependency as it requires putting this in a global.asa file
void Application_Start(object sender, EventArgs e)
{
string connectionString = WebConfigurationManager.
ConnectionStrings["Catalog"].ConnectionString;
SqlDependency.Start(connectionString);
}
However my repository doesn't use a global.asa as its just a library (.dll) not a web application.
Any ideas how to do this? Maybe put whats in the application_start method into the constructor of my repository?