Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Currently using Umbraco 8 for the first time. In previous Umbraco 7, I used Structure Map for our dependency injection.
I know that Umbraco 8 it comes with light inject. However I used to use, ConnectImplementationsToTypesClosing and AddAllTypesOf in structure map. During umbraco start up.
Does anyone know if there's an alternative to this in LightInject in Umbraco 8? Or how I can use structure map instead of light inject
Given you have understanding of Structure Map IOC then Light Inject would be easier for you to pickup. In Umbraco 8, LightInject is the engine that they do use to implement IoC.
I have tried Light Inject and I am delighted to discover the new features.
Just found this in the Registry Factory.
/// To override the default LightInjectContainer, add an appSetting named 'Umbraco.Core.RegisterType' with
/// a fully qualified type name to a class with a static method "Create" returning an IRegister.
Going try that
Using the above we have attempted to create a structure map container and came across issues where Umbraco dependencies were not registering. We, therefore, have now reverted back to light inject and created extension methods.
We are struggling to register all implementations of a given generic type.
For example, given a base class or interface with generic parameters, register all implementations that derive from the base class
This is/was achievable in StructureMap using assembly scanning:
As far as I can see, there is no way to do this with LightInject, meaning I would have to register each and every implementation of the base class
We have tried the following without success
Struggling to identify a solution to this, does anyone have any ideas
Same for us, struggling with transition from StructureMap to LightInject.
We want to accomplish this (from StructureMap):
// Scan adapters for Command/Query handlers.
x => x.Scan(
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted