Example #1
0
        /// <summary>Converts the specified <paramref name="geometry" /> into a <see cref="SqlGeometry" />.</summary>
        /// <param name="geometry">The geometry to convert.</param>
        /// <returns>The converted geometry.</returns>
        public static SqlGeometry ToGeometry(ISimpleGeometry geometry)
        {
            var sg = geometry as SqlGeometry;

            if (sg != null)
            {
                return(sg);
            }

            var sgb = new SqlGeometryBuilderWrapper();

            geometry.Populate(sgb);
            return(sgb.ConstructedGeometry);
        }
Example #2
0
        /// <summary>Converts the specified <paramref name="geometry" /> into a <see cref="SqlGeometry" />.</summary>
        /// <param name="geometry">The geometry to convert.</param>
        /// <returns>The converted geometry.</returns>
        public static SqlGeometry ToGeometry(ISimpleGeometry geometry)
        {
            var sg=geometry as SqlGeometry;
            if (sg!=null)
                return sg;

            var sgb=new SqlGeometryBuilderWrapper();
            geometry.Populate(sgb);
            return sgb.ConstructedGeometry;
        }