-
-
Notifications
You must be signed in to change notification settings - Fork 177
Open
Description
We register custom mappings more then one time in GetCustomMappings.
When we use from i in t.GetTypeInfo().GetInterfaces() we get all interfaces IMapFrom, IMapTo and IHaveCustomMappings => we will register 3 times our mappings if they exist in our model.
var customMaps = from t in types
from i in t.GetTypeInfo().GetInterfaces()
where typeof(IHaveCustomMappings).GetTypeInfo().IsAssignableFrom(t) &&
!t.GetTypeInfo().IsAbstract &&
!t.GetTypeInfo().IsInterface
select (IHaveCustomMappings)Activator.CreateInstance(t);
Fix
var customMaps = from t in types
where typeof(IHaveCustomMappings).GetTypeInfo().IsAssignableFrom(t) &&
!t.GetTypeInfo().IsAbstract &&
!t.GetTypeInfo().IsInterface
select (IHaveCustomMappings)Activator.CreateInstance(t);
botrot
Metadata
Metadata
Assignees
Labels
No labels