Does Unity offer anything similar to Ninject custom providers?

I'm not sure if you can do it directly, but I think you could achieve something similar by doing the following: public interface IMyType { //whatever you need } public interface IMyTypeProvider { IMyType Create(object context); } public class MyTypeProvider : IMyTypeProvider { public IMyType Create(object context) { //construct required instance based on context } } public class ClassWhichNeedsMyType { public ClassWhichNeedsMyType(IMyTypeProvider provider) { this. MyType = provider. Create(this); } private IMyType myType; } then register the provider with the container, and use that to construct your dependency: container.RegisterType().

Thank you, ended up using a similar approach – devdigital Mar 3 at 11:52.

I'm not sure if you can do it directly, but I think you could achieve something similar by doing the following.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions