/// <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); }
/// <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; }