From 9d96b75514eca5b9edd558c90ef100725eb6f429 Mon Sep 17 00:00:00 2001 From: AndriySvyryd Date: Sat, 13 Jun 2020 20:46:24 -0700 Subject: [PATCH] Escape | using ^ instead of / Fixes #20665 --- .../ValueGeneration/Internal/IdValueGenerator.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/EFCore.Cosmos/ValueGeneration/Internal/IdValueGenerator.cs b/src/EFCore.Cosmos/ValueGeneration/Internal/IdValueGenerator.cs index 16bb5eb0416..124b57cdc0d 100644 --- a/src/EFCore.Cosmos/ValueGeneration/Internal/IdValueGenerator.cs +++ b/src/EFCore.Cosmos/ValueGeneration/Internal/IdValueGenerator.cs @@ -5,7 +5,6 @@ using System.Linq; using System.Text; using Microsoft.EntityFrameworkCore.ChangeTracking; -using Microsoft.EntityFrameworkCore.Cosmos.Storage.Internal; using Microsoft.EntityFrameworkCore.ValueGeneration; namespace Microsoft.EntityFrameworkCore.Cosmos.ValueGeneration.Internal @@ -77,18 +76,18 @@ private void AppendString(StringBuilder builder, object propertyValue) switch (propertyValue) { case string stringValue: - builder.Append(stringValue.Replace("|", "/|")); + builder.Append(stringValue.Replace("|", "^|")); return; case IEnumerable enumerable: foreach (var item in enumerable) { - builder.Append(item.ToString().Replace("|", "/|")); + builder.Append(item.ToString().Replace("|", "^|")); builder.Append("|"); } return; default: - builder.Append(propertyValue == null ? "null" : propertyValue.ToString().Replace("|", "/|")); + builder.Append(propertyValue == null ? "null" : propertyValue.ToString().Replace("|", "^|")); return; } }