Skip to content

Commit

Permalink
Improve id inference
Browse files Browse the repository at this point in the history
  • Loading branch information
flobernd committed Oct 11, 2024
1 parent 8a074ef commit 5ca97e8
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

using System;
using System.Collections.Concurrent;
using System.Globalization;
using System.Reflection;

#if ELASTICSEARCH_SERVERLESS
Expand Down Expand Up @@ -71,7 +72,7 @@ public string Resolve(Type type, object @object)
cachedLookup = o =>
{
var v = func(o);
return v?.ToString();
return (v is IFormattable f) ? f.ToString(null, CultureInfo.InvariantCulture) : v?.ToString();
};
if (preferLocal)
_localIdDelegates.TryAdd(type, cachedLookup);
Expand Down

0 comments on commit 5ca97e8

Please sign in to comment.