コード例 #1
0
        /// <summary>
        /// Given the canonical primitive type, get the mapping primitive type in the given dataspace
        /// </summary>
        /// <param name="modelType">canonical primitive type</param>
        /// <returns>The mapped scalar type</returns>
        internal override PrimitiveType GetMappedPrimitiveType(PrimitiveTypeKind modelType)
        {
            if (Helper.IsGeometricTypeKind(modelType))
            {
                modelType = PrimitiveTypeKind.Geometry;
            }
            else if (Helper.IsGeographicTypeKind(modelType))
            {
                modelType = PrimitiveTypeKind.Geography;
            }

            PrimitiveType type = null;

            _primitiveTypeMaps.TryGetType(modelType, null, out type);
            return(type);
        }
コード例 #2
0
ファイル: Helper.cs プロジェクト: longde123/playscript
        internal static bool AreSameSpatialUnionType(PrimitiveType firstType, PrimitiveType secondType)
        {
            // for the purposes of type checking all geographic types should be treated as if they were the Geography union type.
            if (Helper.IsGeographicTypeKind(firstType.PrimitiveTypeKind) && Helper.IsGeographicTypeKind(secondType.PrimitiveTypeKind))
            {
                return(true);
            }

            // for the purposes of type checking all geometric types should be treated as if they were the Geometry union type.
            if (Helper.IsGeometricTypeKind(firstType.PrimitiveTypeKind) && Helper.IsGeometricTypeKind(secondType.PrimitiveTypeKind))
            {
                return(true);
            }

            return(false);
        }