Example #1
0
        private DataType ResolvePrimitiveInDataType(DataType dataType, IPrimitiveDataTypeResolver typeResolver)
        {
            var primitiveDataType = dataType as PrimitiveDataType;

            if (primitiveDataType != null)
            {
                return(typeResolver.ResolvePrimitiveType(primitiveDataType));
            }

            var collectionDataType = dataType as CollectionDataType;

            if (collectionDataType != null)
            {
                // using DataTypes.CollectionDataType here will lose nullability information
                return(collectionDataType.WithElementDataType(this.ResolvePrimitiveInDataType(collectionDataType.ElementDataType, typeResolver)));
            }

            var rowDataType = dataType as RowDataType;

            if (rowDataType != null)
            {
                this.FixupProperties(rowDataType.Definition.Properties, typeResolver);
            }

            return(dataType);
        }
        private DataType ResolvePrimitiveInDataType(DataType dataType, IPrimitiveDataTypeResolver typeResolver)
        {
            var primitiveDataType = dataType as PrimitiveDataType;
            if (primitiveDataType != null)
            {
                return typeResolver.ResolvePrimitiveType(primitiveDataType);
            }

            var collectionDataType = dataType as CollectionDataType;
            if (collectionDataType != null)
            {
                // using DataTypes.CollectionDataType here will lose nullability information
                return collectionDataType.WithElementDataType(this.ResolvePrimitiveInDataType(collectionDataType.ElementDataType, typeResolver));
            }

            var rowDataType = dataType as RowDataType;
            if (rowDataType != null)
            {
                this.FixupProperties(rowDataType.Definition.Properties, typeResolver);
            }

            return dataType;
        }