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
  • 34,719
  • 24
  • 185
  • 251

0 Answers0