title: How to add unsaved variable to class which also represents a SQL Server object?
body: <p>I have the following object declared in C# ASP.NET MVC, which represents an object in our Azure SQL Server database.</p>
  
  <pre><code>public class Note
  {
      [Key]
      [HiddenInput(DisplayValue = false)]
      public int Id { get; set; }
  
      [Display(Name = "Last Edited")]
      [HiddenInput(DisplayValue = true)]
      [DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}")]
      public DateTime LastEditDateUTC { get; set; }
  
      [StringLength(300)]
      [DisplayFormat(ConvertEmptyStringToNull = false)]
      [Required(AllowEmptyStrings = true)]
      public String Subject { get; set; }
  
      [StringLength(1000)]
      [DataType(DataType.MultilineText)]
      [DisplayFormat(ConvertEmptyStringToNull = false)]
      [Required(AllowEmptyStrings = true)]
      public String Text { get; set; }
  }
  </code></pre>
  
  <p>This is how I would save this object to the SQL database:</p>
  
  <pre><code>Note note = new Note()
  {
      // Fill out all the variables
  };
  
  try
  {
      mySQLServer.mySQLTable.Add(note);
      mySQLServer.SaveChanges();
  }
  catch (Exception e)
  {
      // Log
  }
  </code></pre>
  
  <p>What I would like is to add one more variable to <code>Note</code> named <code>IsSelected</code>, but I would not like this variable to be saved to the SQL server's table when the <code>mySQLServer.SaveChanges()</code> method is called, because the <code>IsSelected</code> variable would be used with the UI only. Is there a Data Annotation property that can be added to <code>IsSelected</code> to accomplish this? Is this use case even possible?</p>