diff --git a/Directory.Packages.props b/Directory.Packages.props
index c0abbe61659..252927d8e87 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -41,8 +41,8 @@
-
-
+
+
diff --git a/src/EFCore.SqlServer/EFCore.SqlServer.csproj b/src/EFCore.SqlServer/EFCore.SqlServer.csproj
index 64c3f917d64..fff89e95202 100644
--- a/src/EFCore.SqlServer/EFCore.SqlServer.csproj
+++ b/src/EFCore.SqlServer/EFCore.SqlServer.csproj
@@ -50,7 +50,6 @@
-
diff --git a/src/EFCore.SqlServer/Storage/Internal/SqlServerVectorTypeMapping.cs b/src/EFCore.SqlServer/Storage/Internal/SqlServerVectorTypeMapping.cs
index b3c627f39a9..03d199197be 100644
--- a/src/EFCore.SqlServer/Storage/Internal/SqlServerVectorTypeMapping.cs
+++ b/src/EFCore.SqlServer/Storage/Internal/SqlServerVectorTypeMapping.cs
@@ -125,11 +125,11 @@ private sealed class VectorComparer() : ValueComparer>(
// This is because vectors are basically immutable, and it's better to have more efficient change tracking
// equality checks.
private static bool CalculateEquality(SqlVector? x, SqlVector? y)
- => x is null
- ? y is null
- : y is not null && (x.IsNull
- ? y.IsNull
- : !y.IsNull && x.Memory.Span == y.Memory.Span);
+ => x is SqlVector v1 && y is SqlVector v2
+ ? v1.IsNull
+ ? v2.IsNull
+ : !v2.IsNull && v1.Memory.Span == v2.Memory.Span
+ : x is null && y is null;
private static int CalculateHashCode(SqlVector vector)
{
diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/Translations/VectorTranslationsSqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/Translations/VectorTranslationsSqlServerTest.cs
index d795d499ef2..a07969a82c1 100644
--- a/test/EFCore.SqlServer.FunctionalTests/Query/Translations/VectorTranslationsSqlServerTest.cs
+++ b/test/EFCore.SqlServer.FunctionalTests/Query/Translations/VectorTranslationsSqlServerTest.cs
@@ -116,7 +116,7 @@ public class VectorEntity
public int Id { get; set; }
[Column(TypeName = "vector(3)")]
- public SqlVector Vector { get; set; } = null!;
+ public SqlVector Vector { get; set; }
}
public class VectorQueryFixture : SharedStoreFixtureBase