title: combination of two field must be unique in Entity Framework code first approach. how it would?
body: <p>I have two class contacts and groups </p>
  
  <p>Combination of <code>FirstName</code> and <code>LastName</code> must be unique and can add multiple addresses for a single contact. How I can done this in entity framework code first approach?</p>
  
  <pre><code>public class Contacts
  {
      [Key]
      public int ContactID { get; set; }
      [ForeignKey("Group")]
      public int GroupID { get; set; }
      [Required]
      public string FirstName { get; set; }
      [Required]
      public string LastName { get; set; }
      [Required]
      public string Address { get; set; }
      [Required]
      public string Number { get; set; }
      [Required]
      [EmailAddress]
      public string EmailId { get; set; }
      [DataType(DataType.Date)]
      public DateTime CreateDate { get; set; }
      public DateTime? ModifiedDate { get; set; }
  
      public virtual Groups Group { get; set; }
  }
  
  public class Groups
  {
      [Key]
      [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
      public int GroupID { get; set; }
      [Required]
      public string GroupName { get; set; }
      [Required]
      public string GroupDiscription { get; set; }
      public DateTime CreateDate { get; set; }
      public DateTime ModifiedDate { get; set; }
  }
  </code></pre>