ModelBuilder.TypeCreatorBase.VerifyCreateRequest C# (CSharp) Method

VerifyCreateRequest() protected method

Verifies that the minimum required information has been provided in order to create an instance.
The parameter is null. This generator does not support creating the requested value.
protected VerifyCreateRequest ( Type type, string referenceName, LinkedList buildChain ) : void
type System.Type The type of value to generate.
referenceName string Identifies the possible parameter or property name this value is intended for.
buildChain LinkedList The chain of instances built up to this point.
return void
        protected virtual void VerifyCreateRequest(Type type, string referenceName, LinkedList<object> buildChain)
        {
            if (type == null)
            {
                throw new ArgumentNullException(nameof(type));
            }

            if (CanCreate(type, referenceName, buildChain))
            {
                return;
            }

            var message = string.Format(CultureInfo.CurrentCulture, Resources.Error_TypeNotSupportedFormat,
                GetType().FullName, type.FullName);

            throw new NotSupportedException(message);
        }