Exemplo n.º 1
0
 public string GetDeveloperAlias(Developer developer)
 {
     if (ModelState.IsValid)
     {
         return developer.Alias;
     }
     else
     {
         return ModelState["Name"].Errors[0].ErrorMessage;
     }
 }
Exemplo n.º 2
0
 public string GetDeveloperAlias(Developer developer)
 {
     // Since validation exclusion is currently only effective in case of body bound models.
     if (ModelState.IsValid)
     {
         return developer.Alias;
     }
     else
     {
         return ModelState["Name"].Errors[0].ErrorMessage;
     }
 }