title: Removing data annotation from model and placing them in separate class
body: <p>Hi I am working on an asp.net mvc application and I was asked to remove the data annotations from my models and put them in a separate class.The first thing that came to my mind was to use the Fluent API for this.</p>
  
  <p>After a bit of research I realised that the Fluent API can only be used in the code first approach , so I am left with no clue with how I should solve this problem.</p>
  
  <p>I am using the database first approach.</p>
  
  <p>This is how one of my models looks like:</p>
  
  <pre><code>public class BookModel
  {
      public int Id { get; set; }
  
      [Required]
      public string Name { get; set; }
  
      [Required]
      public string Author { get; set; }
  
      [Required]
      [DataType(DataType.MultilineText)]
      public string Description { get; set;}
  
      [Required]
      [DisplayFormat(DataFormatString = "{0:d}" , ApplyFormatInEditMode=true)]
      public DateTime PublicationDate { get; set; }
  
      [Required]
      public int CategoryId { get; set; }
  
      [Required]
      [DataType(DataType.Currency)]
      [DisplayFormat(DataFormatString="{0:c}")]
      public decimal Price { get; set; }
  
      public string BookUrl { get; set; }
  }
  </code></pre>
  
  <p>So can anyone point me in the right direction in order to solve my problem?</p>