We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 32da49a commit cd2a900Copy full SHA for cd2a900
1 file changed
src/IGLib.Core/Console/Validation/Implementations/StringParsing/ParsableStringValidator.cs
@@ -1,19 +1,15 @@
1
using System;
2
-using System.Collections.Generic;
3
-using System.ComponentModel.DataAnnotations;
4
using System.Globalization;
5
-using System.Linq;
6
-using System.Text;
7
-
8
namespace IGLib;
9
+
10
public class ParsableStringValidator<TTarget> : IValidator<string>
11
{
12
private readonly IStringParser<TTarget> _parser;
13
14
public ParsableStringValidator(
15
- IFormatProvider formatProvider = null,
16
- string errorMessage = null)
+ IFormatProvider? formatProvider = null,
+ string? errorMessage = null)
17
18
_parser = StringParserProvider.GetParser<TTarget>(formatProvider ?? CultureInfo.CurrentCulture);
19
ErrorMessage = errorMessage ?? $"Value is not a valid {typeof(TTarget).Name}.";
0 commit comments