Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Display validation message on a collection

$
0
0

I have student object with a child collection of Test. Have a validation on Tests collection defined in the StudentValidator to make sure at least one item is added to collection when saving a student.

In UI, loop through the collection in foreach and have individual textfields binded to Test object.

RuleFor(s => s.Tests).Must(s => s.Count() > 0).WithMessage("At least one Test info must be provided.");

Don't want to display in the ValidationMessage as remaining validations are displayed For() on the property on which validation message is defined.

Where/how do you display this validation message in the UI?


Viewing all articles
Browse latest Browse all 4839

Trending Articles



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