public DefaultPropertyInjectionFactory(IServiceProvider serviceProvider,
     IPropertyResolverFactory resolverFactory)
 {
     _resolverFactory = resolverFactory ?? throw new ArgumentNullException(nameof(resolverFactory));
     _serviceProvider = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider));
 }
 private static ServiceDescriptor SetPropertyInjection(ServiceDescriptor descriptor, IPropertyResolverFactory resolverFactory)
 {
     if (resolverFactory.GetResolvers(descriptor.GetImplementationType()).Any())
     {
         if (null != descriptor.ImplementationInstance)
         {
             return(ServiceDescriptor.Describe(descriptor.ServiceType, provider =>
             {
                 provider.PropertyInjection(descriptor.ImplementationInstance);
                 return descriptor.ImplementationInstance;
             }, descriptor.Lifetime));
         }
         else if (null != descriptor.ImplementationFactory)
         {
             return(ServiceDescriptor.Describe(descriptor.ServiceType, provider =>
             {
                 var instance = descriptor.ImplementationFactory(provider);
                 provider.PropertyInjection(instance);
                 return instance;
             }, descriptor.Lifetime));
         }
         else
         {
             return(ServiceDescriptor.Describe(descriptor.ServiceType, provider =>
             {
                 var instance = ActivatorUtilities.CreateInstance(provider, descriptor.ImplementationType);
                 provider.PropertyInjection(instance);
                 return instance;
             }, descriptor.Lifetime));
         }
     }
     return(descriptor);
 }