MVC data annotations - dynamic string length
<p>I have a data attribute for the string length defined as below for 40 characters.    </p>

<pre><code>[Display(Name = "Name"), StringLength(40, ErrorMessage = "The name cannot be more than 40 characters")]
public string EmployeeName { get; set; }
</code></pre>

<p>Now the requirement is changed to get that value from the service. </p>

<p>Is there a way to get that value into these data attributes something like: 
string s = 50; //Let's say calls the service to get this value</p>

<pre><code>[Display(Name = "Name"), StringLength(s, ErrorMessage = "The name cannot be more than {0} characters")]
public string EmployeeName { get; set; }
</code></pre>