Global Directory
Global Directory
EXPLORE OUR SITES
London Stock Exchange Group
LSEG Data & Analytics
MyAccount
LSEG Perspectives
London Stock Exchange
FTSE Russell
LCH
Contact Us
Home
TR Internal
Platform Website setup to allow constructor-based dependency injection of controllers?
Ryan Morlok
Is the Cobalt Platform Website setup to allow constructor-based dependency injection of controllers? In the Advisor product I'm looking to inject my services into my controllers and I don't want to have to reference the IoC explicitly. If it is supported, can someone point me to an example of where it is being used?
Find more posts tagged with
refinitiv-internal
Accepted answers
Jake Anstadt
Yup, its set up to handle constructor injection. Check out PromotionsWorkflow.cs. Also, be sure to register your interface and workflow/service in the proper location in Bootstrapper.cs.
Bootstrappers.RegisterAppLayer.DoRegistration();
Bootstrappers.RegisterServices.DoRegistration();
All comments
Jake Anstadt
Yup, its set up to handle constructor injection. Check out PromotionsWorkflow.cs. Also, be sure to register your interface and workflow/service in the proper location in Bootstrapper.cs.
Bootstrappers.RegisterAppLayer.DoRegistration();
Bootstrappers.RegisterServices.DoRegistration();
Ryan Morlok
Thanks Jake!
Andrew Gerber
One little nitpick: Do the IoC registrations in your product's Product.cs file instead of the Bootstrapper... either Product.InitializeRequest or Product.Initialize. Take a look at how WestlawNext is doing it:
\data\Website\WestlawNext\WestlawNext.Web\Product.cs
Andrew Gerber
Whoops... based on your other questions you probably already know this
Quick Links
All Forums
Recent Questions
Terms of use
Privacy & Cookie Statement
Cookies settings
Do not sell my info
Whistleblowing
UK Bribery Act
Modern Slavery Act