Skip to content

Commit f00da59

Browse files
committed
Lower extension method overloads for signature with object lower
1 parent 1117a4a commit f00da59

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/Jeffijoe.MessageFormat/MessageFormatter.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using System.Collections.Concurrent;
99
using System.Diagnostics.CodeAnalysis;
1010
using System.Linq;
11+
using System.Runtime.CompilerServices;
1112
using System.Text;
1213
using Jeffijoe.MessageFormat.Formatting;
1314
using Jeffijoe.MessageFormat.Formatting.Formatters;
@@ -203,6 +204,7 @@ public static string Format(string pattern, IReadOnlyDictionary<string, object?>
203204
/// <returns>
204205
/// The formatted message.
205206
/// </returns>
207+
[OverloadResolutionPriority(-1)]
206208
[RequiresUnreferencedCode("This method uses the FormatMessage extension which uses reflection to convert object into dictionary")]
207209
public static string Format(string pattern, object data)
208210
{
@@ -392,4 +394,4 @@ private IFormatterRequestCollection ParseRequests(string pattern, StringBuilder
392394
}
393395

394396
#endregion
395-
}
397+
}

src/Jeffijoe.MessageFormat/MessageFormatterExtensions.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System.Collections.Generic;
22
using System.Diagnostics.CodeAnalysis;
3+
using System.Runtime.CompilerServices;
34
using Jeffijoe.MessageFormat.Helpers;
45

56
namespace Jeffijoe.MessageFormat;
@@ -47,9 +48,10 @@ public static string FormatMessage(
4748
/// <returns>
4849
/// The <see cref="string" />.
4950
/// </returns>
51+
[OverloadResolutionPriority(-1)]
5052
[RequiresUnreferencedCode("This method uses the ToDictionary extension which uses reflection to convert object into dictionary")]
5153
public static string FormatMessage(this IMessageFormatter formatter, string pattern, object args)
5254
{
5355
return formatter.FormatMessage(pattern, args.ToDictionary());
5456
}
55-
}
57+
}

0 commit comments

Comments
 (0)