Skip to content

Commit dd0572a

Browse files
floberndgithub-actions[bot]
authored andcommitted
Improve id inference (#8379)
1 parent 2c0c33c commit dd0572a

File tree

1 file changed

+2
-1
lines changed
  • src/Elastic.Clients.Elasticsearch/_Shared/Core/Infer/Id

1 file changed

+2
-1
lines changed

Diff for: src/Elastic.Clients.Elasticsearch/_Shared/Core/Infer/Id/IdResolver.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
using System;
66
using System.Collections.Concurrent;
7+
using System.Globalization;
78
using System.Reflection;
89

910
#if ELASTICSEARCH_SERVERLESS
@@ -71,7 +72,7 @@ public string Resolve(Type type, object @object)
7172
cachedLookup = o =>
7273
{
7374
var v = func(o);
74-
return v?.ToString();
75+
return (v is IFormattable f) ? f.ToString(null, CultureInfo.InvariantCulture) : v?.ToString();
7576
};
7677
if (preferLocal)
7778
_localIdDelegates.TryAdd(type, cachedLookup);

0 commit comments

Comments
 (0)