示例#1
0
        private void CompleteClrType(
            ITypeInitializationContext context)
        {
            if (ClrType == null &&
                context.TryGetNativeType(this, out Type clrType))
            {
                ClrType = clrType;
            }

            if (ClrType == null)
            {
                ClrType = typeof(object);
            }
        }
        private void CompleteNativeType(
            ITypeInitializationContext context)
        {
            if (ClrType == null &&
                context.TryGetNativeType(this, out Type nativeType))
            {
                ClrType = nativeType;
            }

            if (ClrType == null)
            {
                // TODO :resources
                context.ReportError(new SchemaError(
                                        "Could not resolve the native type associated with " +
                                        $"input object type `{Name}`.",
                                        this));
            }
        }
        private void CompleteNativeType(
            ITypeInitializationContext context)
        {
            if (ClrType == null &&
                context.TryGetNativeType(this, out Type nativeType))
            {
                ClrType = nativeType;
            }

            if (ClrType == null)
            {
                context.ReportError(new SchemaError(
                                        "Could not resolve the native type associated with " +
                                        $"input object type `{Name}`.",
                                        this));
            }

            _deserialize = InputObjectDeserializerFactory.Create(
                context, this, ClrType);
        }