Пример #1
0
 /// <summary>
 /// Resolve multiple types
 /// </summary>
 public IEnumerable <object> GetServices(Type serviceType)
 {
     if (UnityRegistrationCache.IsRegistered(container, serviceType))
     {
         return(container.ResolveAll(serviceType));
     }
     return(new List <object>());
 }
Пример #2
0
 /// <summary>
 /// Resolve a type
 /// </summary>
 public object GetService(Type serviceType)
 {
     if (!UnityRegistrationCache.IsRegistered(container, serviceType))
     {
         if (serviceType.IsAbstract || serviceType.IsInterface)
         {
             return(null);
         }
     }
     return(container.Resolve(serviceType));
 }