I've been looking for an answer but couldn't find one. I have a project which uses StructureMap as it's dependency container but now I want to try Microsoft's unity.
However, I couldn't find how to convert this piece of code to unity:
ObjectFactory.Initialize(cfg =>
{
cfg.For<IViewFactory>().Use<DefaultViewFactory>();
cfg.Scan(scan =>
{
scan.TheCallingAssembly();
scan.ConnectImplementationsToTypesClosing(typeof(IViewBuilder<>)); scan.ConnectImplementationsToTypesClosing(typeof(IViewBuilder<,>));
});
});
I know the cfg.For... part is simply calling container.RegisterType(); but how can I do the scan part in Unity?