title: Use a struct in place of a primitive for a EF4 property type
body: <p>I've got an EF4 entity (code-first) that includes an int bitmask. I've created a Bitmask struct to make working with bitmasks easier (provides bool properties to access the bits). The bitmask struct includes overloaded implicit operators for converting to and from an int. </p>
  
  <p>I tried setting the property type to the bitmask struct but the value is coming back as 0. I know the value in the database has a value and the bitmask works in my unit tests. I set the HasColumnType to "INT".</p>
  
  <p>The property...</p>
  
  <pre><code>[Required]
  [Display(Name = "Display Pages Bitmask")]
  [Column(Name = "fDisplayPagesBitmask")]
  public DisplayPagesBitmask DisplayPagesBitmask { get; set; }
  </code></pre>
  
  <p>From the context object...</p>
  
  <pre><code>protected override void OnModelCreating(ModelBuilder builder)
  {
      builder.Entity&lt;Website&gt;()
          .Property(m =&gt; m.DisplayPagesBitmask)
          .HasColumnType("INT");
  }
  </code></pre>
  
  <p>Is this possible? If so, what do I need to do to get it to work?</p>