0
votes

I would like to use the registration by convention feature from unity in a project. Therefore, I followed this guide from Microsoft. Unfortunately, I am not able to find the property MatchingInterface from the class WithMappings. I would like to use this property since I have multiple classes and interface like IFoo and Foo.

Does someone solved this problem or have a idea?

My unity container version is 5.2.1., freshly installed from NuGet.

1

1 Answers

1
votes

It seems that implementation of the method RegisterTypes() changed. The second parameter requires a function delegate which returns the types which are matching the some condition. In my case container.RegisterTypes(AllClasses.FromAssembliesInBasePath(), (c) => WithMappings.FromMatchingInterface(c)); solved the problem.