Closed vxhoa closed 7 years ago
What is the entry point in a class library?
A class library does not have an entry point.
how to set up SimpleInjector in a class library.
You don't. You set up your DI Container inside the Composition Root and only start-up projects (your MVC project) should contain a Composition Root.
Hi @vxhoa! How have you been? I'll give my 2 cents here.
In my scenario, I created a "Cross-cutting" library that has references to every other "injectable" library in my project. This way, I could inject repositories on some integration tests, just by creating a "base test class" that calls my container configuration method (from that "cross-cutting" library) inside of this "base test class" constructor method.
This way, my base test class act as a "composition root" for every integration test (I know that it's not the best approach but I'll fine tune this later).
Reminder: This is NOT a proper way of doing things, but it's the easiest way I found to "inject my injectables" inside an integration test project.
Hi,
I created a class library project that it is being used/referred in the ASP.NET MVC project. The question is how to set up SimpleInjector in a class library. What is the entry point in a class library?
Thanks Hoa