From 3d7451e7fc2d6b494e31b4046b8fc33e060d5012 Mon Sep 17 00:00:00 2001 From: Austin Drenski Date: Sun, 29 Jul 2018 15:49:34 -0400 Subject: [PATCH] Add type-casts for SQL literals in list mapping --- .../Storage/Internal/Mapping/NpgsqlListTypeMapping.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/EFCore.PG/Storage/Internal/Mapping/NpgsqlListTypeMapping.cs b/src/EFCore.PG/Storage/Internal/Mapping/NpgsqlListTypeMapping.cs index 49d6741c8..a3666015f 100644 --- a/src/EFCore.PG/Storage/Internal/Mapping/NpgsqlListTypeMapping.cs +++ b/src/EFCore.PG/Storage/Internal/Mapping/NpgsqlListTypeMapping.cs @@ -88,7 +88,9 @@ protected override string GenerateNonNullSqlLiteral(object value) sb.Append(ElementMapping.GenerateSqlLiteral(list[i])); } - sb.Append(']'); + sb.Append("]::"); + sb.Append(ElementMapping.StoreType); + sb.Append("[]"); return sb.ToString(); } @@ -143,7 +145,7 @@ static bool Compare(List a, List b, ValueComparer elementCo static List Snapshot(List source, ValueComparer elementComparer) { - if (source is null) + if (source == null) return null; var snapshot = new List(source.Count); @@ -194,7 +196,7 @@ static bool Compare(List a, List b) static List DoSnapshot(List source) { - if (source is null) + if (source == null) return null; var snapshot = new List(source.Count); @@ -243,7 +245,7 @@ static bool Compare(List a, List b) static List DoSnapshot(List source) { - if (source is null) + if (source == null) return null; var snapshot = new List(source.Count);