Skip to content

Commit eafb047

Browse files
RehanSaeedJeremySkinner
authored andcommitted
Make prefix optional
1 parent 6bdf76c commit eafb047

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/FluentValidation.AspNetCore/ValidationResultExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public static class ValidationResultExtension {
3737
/// <param name="result">The validation result to store</param>
3838
/// <param name="modelState">The ModelStateDictionary to store the errors in.</param>
3939
/// <param name="prefix">An optional prefix. If omitted, the property names will be the keys. If specified, the prefix will be concatenated to the property name with a period. Eg "user.Name"</param>
40-
public static void AddToModelState(this ValidationResult result, ModelStateDictionary modelState, string prefix) {
40+
public static void AddToModelState(this ValidationResult result, ModelStateDictionary modelState, string prefix = null) {
4141
if (!result.IsValid) {
4242
foreach (var error in result.Errors) {
4343
string key = string.IsNullOrEmpty(prefix)

0 commit comments

Comments
 (0)