Skip to content

Commit 4806b9e

Browse files
committed
Fix EF Core issue, where MySqlGeometry.Value of type ReadOnlySpan<byte> will throw an exception in Microsoft.EntityFrameworkCore.Storage.Internal.DbParameterCollectionExtensions.FormatParameterValue(StringBuilder builder, object parameterValue).
Signed-off-by: Laurents Meyer <[email protected]>
1 parent 40592cf commit 4806b9e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/MySqlConnector/MySql.Data.Types/MySqlGeometry.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ public static MySqlGeometry FromWkb(int srid, ReadOnlySpan<byte> wkb)
3838
/// <summary>
3939
/// The Well-known Binary serialization of this geometry.
4040
/// </summary>
41-
public ReadOnlySpan<byte> WKB => Value.Slice(4);
41+
public ReadOnlySpan<byte> WKB => new ReadOnlySpan<byte>(Value).Slice(4);
4242

4343
/// <summary>
4444
/// The internal MySQL form of this geometry.
4545
/// </summary>
46-
public ReadOnlySpan<byte> Value => m_bytes;
46+
public byte[] Value => m_bytes;
4747

4848
internal MySqlGeometry(byte[] bytes) => m_bytes = bytes;
4949

0 commit comments

Comments
 (0)