Skip to content

Commit

Permalink
Escape | using ^ instead of /
Browse files Browse the repository at this point in the history
Fixes #20665
  • Loading branch information
AndriySvyryd committed Jun 14, 2020
1 parent 0d81662 commit 9d96b75
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 9d96b75

Please sign in to comment.