title: Exclude a column from DbContext using ASP.NET MVC and EntityFramework
body: <p>I have the following model:</p>
  
  <pre><code>public class Movie
  {
      public int Id { get; set; }
  
      [Required]
      public string Title { get; set; }
  
      [DataType(DataType.DateTime)]
      [Display(Name = "Release date")]
      [DisplayFormat(DataFormatString = "{0:dd-MM-yyyy}")]
      public DateTime ReleaseDate { get; set; }
  
      [Required]
      public string Genre { get; set; }
  
      [Required]
      [Range(1, 20)]
      public decimal Price { get; set; }
  
      [Required]
      [DataType(DataType.EmailAddress)]
      public string Email
      {
          get;
          set;
      }
  
      [Compare("Email")]
      public string ConfirmEmail
      {
          get;
          set;
      }
  }
  </code></pre>
  
  <p>and Db context:</p>
  
  <pre><code>public class MovieDbContext : DbContext
  {
      public DbSet&lt;Movie&gt; Movies { get; set; }
  }
  </code></pre>
  
  <p>and my table looks like:</p>
  
  <pre><code>CREATE TABLE [dbo].[Movies] (
      [Id]          INT            IDENTITY (1, 1) NOT NULL,
      [Title]       NVARCHAR (50)  NOT NULL,
      [ReleaseDate] DATETIME       NOT NULL,
      [Genre]       NVARCHAR (50)  NOT NULL,
      [Price]       DECIMAL (6, 2) NOT NULL,
      [Email]       NVARCHAR (100) DEFAULT ('') NOT NULL,
      PRIMARY KEY CLUSTERED ([Id] ASC)
  );
  </code></pre>
  
  <p>As you see, I added a new property called <code>ConfirmEmail</code> attached to <code>Movie</code> model. But I didn't add to table and I don't want to.</p>
  
  <p>When run application, an error is occured:</p>
  
  <p>Unknown column name <code>ConfirmEmail</code>.</p>
  
  <p><strong>Does it is possible to exclude that <code>ConfirmEmail</code> from context ?</strong> </p>
  
  <p>It is just used as parameter to be compared to <code>Email</code> property.</p>
  
  <p>Thanks</p>