Skip to content

Commit

Permalink
Fix NpgsqlCharacterStringTypeMapping for compiled model
Browse files Browse the repository at this point in the history
Fixed in main in #3089

Fixes #2974
  • Loading branch information
roji committed May 11, 2024
1 parent e3a6f37 commit 51faf6e
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,13 @@ protected override void ConfigureParameter(DbParameter parameter)
base.ConfigureParameter(parameter);
}

private static bool EqualsWithoutTrailingWhitespace(string? a, string? b)
/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public static bool EqualsWithoutTrailingWhitespace(string? a, string? b)
=> (a, b) switch
{
(null, null) => true,
Expand All @@ -131,6 +137,12 @@ private static bool EqualsWithoutTrailingWhitespace(string? a, string? b)
_ => a.AsSpan().TrimEnd().SequenceEqual(b.AsSpan().TrimEnd())
};

private static int GetHashCodeWithoutTrailingWhitespace(string a)
/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public static int GetHashCodeWithoutTrailingWhitespace(string a)
=> a.TrimEnd().GetHashCode();
}

0 comments on commit 51faf6e

Please sign in to comment.