Hello,
I have the following:
When(x => x.Mark == MarkType.Annex, () => {
Custom(x => {
HttpPostedFileBase file = x.Files.First();
if (file.ContentLength > 20971520)
new ValidationFailure("Files", "The maximum file size is 20 MB");
return null;
});
});
When I submit the form the x.Files.First() gives an error ...
However, this should not even run because x.Mark is not Annex and the condition is false.
I debugged it and the condition is really false.
Any idea what is wrong?
Thank you,
Miguel