Skip to content

Commit ec00400

Browse files
committed
Inverted logic of type conversion such that parser provider can fit into scheme
1 parent 4f26b3c commit ec00400

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/IGLib.Core/Console/Validation/Implementations/StringParsing/StringParserProvider.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@ internal static class StringParserProvider
1313
{
1414
public static IStringParser<T> GetParser<T>(IFormatProvider? formatProvider = null)
1515
{
16-
Type targetType = typeof(T);
17-
IFormatProvider provider = formatProvider ?? CultureInfo.CurrentCulture;
18-
16+
object parser = GetParser(typeof(T), formatProvider ?? CultureInfo.CurrentCulture);
1917

18+
return (IStringParser<T>)parser;
19+
}
2020

21+
private static object GetParser(Type targetType, IFormatProvider formatProvider)
22+
{
2123

24+
throw new NotImplementedException();
2225

23-
throw new NotSupportedException(
24-
$"No built-in string parser is available for target type '{targetType.FullName}'.");
2526
}
2627

27-
2828
}
2929

3030
}

0 commit comments

Comments
 (0)