Пример #1
0
        private void CompleteClrType(
            ITypeInitializationContext context)
        {
            if (ClrType == null &&
                context.TryGetNativeType(this, out Type clrType))
            {
                ClrType = clrType;
            }

            if (ClrType == null)
            {
                ClrType = typeof(object);
            }
        }
Пример #2
0
        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));
            }
        }
Пример #3
0
        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);
        }