Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IOC to register repositories in service layer and services in the preentation layer

I'm using structuremap to register a service in the controller and i need to register repositories in services too. How I'll do that since they are 2 different projects and need the exact same IOC registration. Actually I'm using It on the presentation layer and injecting services in the controller. I need to know a good pratice way to make, with the same IOC container, injection in the both projects.

like image 714
diego Avatar asked Feb 01 '26 10:02

diego


1 Answers

Put the IOC container, and any shared service implementations, into a third project (class library) that is referenced by both of the other two.

like image 75
David M Avatar answered Feb 04 '26 00:02

David M



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!