title: How to retrieve data annotation strings from Database > Resource File in C#?
body: <p>In ASP.NET MVC5 we''re using Resource files which are great for allowing providing translations across applications. This works well for Annotations aswell.</p>
  
  <pre><code>    [Required]
      [Display(Name = "ROLE", ResourceType = typeof(AdminRes))]
      public string UserRole { get; set; }
  </code></pre>
  
  <p>The strings for the Annotations are currently stored in Resource-Files.</p>
  
  <p>But what I want to achieve is the following: I want to check a database if a certain string (i.e. "ROLE") exists. If it does, I want to use it as <code>[Display(Name = "string")</code>. If there was no such string found, I want to use the existing Resource-File as alternative and get the string from there.</p>
  
  <p>Any plain idea how to get this working?</p>