/// <inheritdoc />
        /// <exception cref="ArgumentNullException">The <paramref name="executeStrategy" /> parameter is <c>null</c>.</exception>
        /// <exception cref="ArgumentNullException">The <paramref name="type" /> parameter is <c>null</c>.</exception>
        public object?Build(IExecuteStrategy executeStrategy, Type type, params object?[]?arguments)
        {
            executeStrategy = executeStrategy ?? throw new ArgumentNullException(nameof(executeStrategy));

            type = type ?? throw new ArgumentNullException(nameof(type));

            var capability = new CircularReferenceCapability();

            return(capability.CreateType(executeStrategy, type, arguments));
        }
        /// <inheritdoc />
        /// <exception cref="ArgumentNullException">The <paramref name="executeStrategy" /> parameter is <c>null</c>.</exception>
        /// <exception cref="ArgumentNullException">The <paramref name="propertyInfo" /> parameter is <c>null</c>.</exception>
        public object?Build(IExecuteStrategy executeStrategy, PropertyInfo propertyInfo, params object?[]?arguments)
        {
            executeStrategy = executeStrategy ?? throw new ArgumentNullException(nameof(executeStrategy));

            propertyInfo = propertyInfo ?? throw new ArgumentNullException(nameof(propertyInfo));

            var capability = new CircularReferenceCapability();

            return(capability.CreateProperty(executeStrategy, propertyInfo, arguments));
        }
        private static IBuildCapability?GetCapability(IBuildChain buildChain, Type type)
        {
            var circularReference = CircularReferenceCapability.FindItemByType(buildChain, type);

            if (circularReference == null)
            {
                return(null);
            }

            return(new CircularReferenceCapability());
        }