Example #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>());
 }
Example #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));
 }