1

My question is the following:

Is there any chance to avoid hardocode the string to set the ErrorMessage=".."?

[Required(ErrorMessage="My message harcoded")]

public int ID { get; set; }

I can't use a method like this, because ErrorMessage only accept a const.

[Required(ErrorMessage = GetErrorMessage())]

public int ID { get; set; }
Cœur
  • 37,241
  • 25
  • 195
  • 267

0 Answers0