I am using Unity 2.0 to register a concrete SQL Server repository against an abstract repository like so:
var context = new DataContext(
ConfigurationManager.ConnectionStrings["DevDB"].ConnectionString
);
this.UnityContainer
.RegisterType<AlertQueueRepository, Sql.AlertQueueRepository>(
new InjectionConstructor(context)
);
The context is being shared across all of the other repositories that I have. This works fine within the application, however, if someone else - SSMS query, SSIS package, other application - modifies the database my repositories are unaware of this and will not see the change.
Is this an issue with the way I'm using Unity? Perhaps the contexts are hanging around too long? Or is it something I need to configure with LINQ?