Skip to content

Commit 6797a52

Browse files
committed
refactor: Change input type of parsers to StringValues for better handling
1 parent 4f5e666 commit 6797a52

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

API/SOFTURE.Common.StronglyTypedIdentifiers/API/Parsers/IdentifierParsers.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
using FastEndpoints;
2+
using Microsoft.Extensions.Primitives;
23
using SOFTURE.Language.Common;
34

45
namespace SOFTURE.Common.StronglyTypedIdentifiers.API.Parsers;
56

67
public static class IdentifierParsers
78
{
8-
public static ParseResult GuidParser<TIdentifier>(object? input)
9+
public static ParseResult GuidParser<TIdentifier>(StringValues input)
910
where TIdentifier : IIdentifier
1011
{
1112
var success = Guid.TryParse(input?.ToString(), out var result);
@@ -15,7 +16,7 @@ public static ParseResult GuidParser<TIdentifier>(object? input)
1516
return new ParseResult(success, identifier);
1617
}
1718

18-
public static ParseResult NumberParser<TIdentifier>(object? input)
19+
public static ParseResult NumberParser<TIdentifier>(StringValues input)
1920
where TIdentifier : IIdentifier
2021
{
2122
var success = int.TryParse(input?.ToString(), out var result);

0 commit comments

Comments
 (0)