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