title: EF Code First(existing database) Relate single entity with two table
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/10070664/how-map-single-entity-with-multiple-table">How map single entity with multiple table</a>  </p>
  </blockquote>
  
  
  
  <p>I want to get data from two tables and store it into one entity. How??</p>
  
  <p><br/>Entity Class:</p>
  
  <pre><code> public class HomeViewModel
  {
      [Key]
      [Column("candidate_ID")]
      public int candidateID { get; set; }
      [Column("first_name")]
      public string firstName { get; set; }
      [Column("last_name")]
      public string lastName { get; set; }
  
     // [Column("")]
      public string emailID { get; set; }
     // [Column("")]
      public string mb_country_code { get; set; }
      //[Column("")]
      public int mobile_no { get; set; }
  }
  </code></pre>
  
  <p><br/></p>
  
  <p>Above entity class holds 6 property where 3 property represents ont table1 and 3 represents table2.
  <br/> At database table 1 holds candidate_id as primary key and tablte two holds candidate_id as foreign key.</p>