private object ResolveParameter(Type type, ParameterInfo parameterInfo)
            {
                //Use default parameter value.
                if (parameterInfo.IsOptional && !_container.CanResolve(type))
                {
                    return(parameterInfo.DefaultValue);
                }

                var hasParamsAttr = parameterInfo.IsDefined(typeof(ParamArrayAttribute), false);

                //If have ParamArrayAttribute.
                if (hasParamsAttr)
                {
#if NET4
                    var originalType = type.GetElementType();
#else
                    var originalType = type.GetTypeInfo().GetElementType();
#endif

                    //If exist array binding.
                    if (_container.CanResolve(type))
                    {
                        return(_container.Get(type));
                    }

                    //If exist binding for type.
                    if (_container.CanResolve(originalType))
                    {
                        return(ConvertToArray(type, _container.GetAll(originalType)));
                    }
                    return(ConvertToArray(type, new object[0]));
                }
                return(_container.Get(type));
            }
        public bool CanResolve(Type service, string name = null)
        {
            this.NotBeDisposed();
            Should.NotBeNull(service, nameof(service));
            var key = new BindingKey(service, name);

            lock (_bindingRegistrations)
            {
                if (_bindingRegistrations.ContainsKey(key))
                {
                    return(true);
                }
            }
            if (_parent == null)
            {
                return(IsSelfBindableType(service));
            }
            return(_parent.CanResolve(service, name));
        }