Hello
Is there a way of making my context implement an interface? It would certainly help me a lot by increasing testability, since I could, then, create FakeContext to use in my unit tests.
I tried doing so by creating another partial Context class and implementing my hard coded interface. But the generated context uses the DbSet concrete class instead of IDbSet abstraction, which makes my interface useless.
Please, let me know if I wasn't clear.
Thank you for your support.
DbContext implement interface to leverage testability
-
- Posts: 7
- Joined: Fri 22 Aug 2014 19:07
Re: DbContext implement interface to leverage testability
Please modify a predefined templates with an embedded T4 Editor which comes with Entity Developer to implement the needed code generation.
T4 documentation:
T4 documentation:
- download http://www.devart.com/entitydeveloper/e ... eloper.chm and open the Common Concepts > Working with Templates section
- general T4 reference, e.g. http://msdn.microsoft.com/en-us/library/bb126478.aspx