I had Telerik Data Access contexts instantiated in many projects in my solution.
Right now in separate project MyContextProject
I created a class MyContext
which instatiates and returns proper Telerik context and replaced all instantiations of Telerik's context with MyContext
.
I want to prevent anybody from explicitly instantiating Telerik's Data Access context outside of MyContextProject
however I don't want to restrict usage of any other types from Telerik Data Access.
Is this is achievable? Is there a way maybe to create an annotation as I don't know of any mechanism in C# that would support this.
I tried to make it a generic question, Telerik can be replaced with any other library.