79345368

Date: 2025-01-10 10:32:55
Score: 1.5
Natty:
Report link

Yes there is a way, see here: https://docs.fluentvalidation.net/en/latest/custom-validators.html#custom-message-placeholders

RuleFor(mb => mb.Amount).
Must((mb, amount, context) =>
{
  var betLimit = _battlesService.GetBetLimit(mb.BattleId);
  context.MessageFormatter.AppendArgument("BetLimit", betLimit );
  mb.Amount <= betLimit;
}).
WithMessage("Bet should be less than {BetLimit}");
Reasons:
  • Probably link only (1):
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Ben5