How to get dependency injection for custom ITaxCalculator in Commerce Manager

Vote:
 

Hi

So I have written a custom ITaxCalculator, which is cofigured in our StructureMap configuration initialization, and it works as needed in the website. But how do I get Commerce Manager's dependency injection (or StructureMap) to also use my implementation instead of the default?

Matt

(Episerver CMS 11.9.2 with Commerce 11.8.5)

#195319
Jul 20, 2018 6:09
Vote:
 

You should have separate project with all of your custom implementations and their registration, and this project's assembly should be deployed in both your frontend and CM bin folder

#195320
Jul 20, 2018 6:14
Vote:
 

Hi Quan

Yeah, my custom class is deployed in a shared dll (separate project) to CM.. But I think I'm missing something, how would CM know to use that class? In web I have that structuremap configuration that tells it, but nothing yet would tell CM to use that class for ITaxCalculator..

Matt

#195321
Jul 20, 2018 6:16
Vote:
 

Okay, think I missed your "and registration" which I haven't done outside of my web project. Now that I've also registered it in the shared project, Commerce Manager uses it now :)

#195322
Jul 20, 2018 7:01
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.