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
Following from another question I had, I can see Umbraco8 provides the lightinject DI setup. I could possibly switch to use this for basic DI.
What I was particularly struggling with is that I am factory class (pattern) which worked great with AutoFac and the named and keyed services. Autofac adds this to a IIndex.
In the DI I had this ...
.Where(type => type.GetInterfaces().Contains(typeof(ITransform)))
.Keyed<ITransform>(transform => transform.Name);
then in the factory class constructor I had ...
public TransformFactory(IMyAwesomeContext awesomeContext, IIndex
I had a number of classes implementing ITransform. Within the factory I could then simply do this ... to get at the required object.
_transforms.TryGetValue("UserTransform", out transformObject);
so my question is, how do I do that with lightinject within Umbraco8 ? ...
I am hoping I can stick with Autofac to be consistent with my Umbraco7 project. Will be a little confused if I need to change the DI to sit with lighinject (seeing Umbraco let us use our own DI packages).
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted