Exemplo n.º 1
0
 public static void RegisterRepository(this IIocManager instance, Type type, Type interRepositoryType, string name)
 {
     if (type.IsGenericType)
     {
         Type interfaceType = type.GetInterfaces().FirstOrDefault(item => item.GetInterfaces().Any(c => c.GUID == typeof(IRepository <,>).GUID) && item.GUID != typeof(IRepository <,>).GUID);
         if (interfaceType.IsNotNull())
         {
             instance.RegisterGeneric(type, interfaceType, name);
         }
         instance.RegisterGeneric(type, interRepositoryType, name);
     }
     else
     {
         instance.RegisterTypes(type);
     }
 }