I am using FluentValidation and I want to format a message with some of the object\'s properties value. The problem is I have very little experience with expressions and delegat
For anyone looking into this now - current FluentValidation (v8.0.100) allows you use a lamda in WithMessage (As ErikE suggested above) so you can use:
RuleFor(x => x.Name).NotEmpty()
.WithMessage(x => $"The name {x.Name} is not valid for Id {x.Id}.");