Quantcast
Channel: Fluent Validation for .NET
Viewing all articles
Browse latest Browse all 1917

Commented Issue: Equal does not use the Display Attribute [7125]

$
0
0
```c#
[Display(Name = "NewPassword", ResourceType = typeof(Labels))]
[DataType(DataType.Password)]
public string NewPassword { get; set; }

[Display(Name = "NewPasswordVerification", ResourceType = typeof(Labels))]
[DataType(DataType.Password)]
public string NewPasswordVerification { get; set; }
```
```c#
RuleFor(m => m.NewPasswordVerification).Equal(m => m.NewPassword);
```

Output:
Nieuw wachtwoord [input field]
Nieuw wachtwoord bevestigen [input field] 'Nieuw wachtwoord bevestigen' moet gelijk zijn aan 'NewPassword'.
Comments: I'll try to go through the source code this week because I do think this is a FluentValidation issue. The Display attribute is used for the source ('Nieuw wachtwoord bevestigen' is a resource string), but not for the target ('NewPassword' is the field name). Of course I could be entirely wrong :)

Viewing all articles
Browse latest Browse all 1917

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>