title: Entity Framework with Sql Server Column Level Encryption
body: <p>I have a requirement to encrypt a number of database columns (in Sql Server 2012). It has been decided that we should use column level encryption (implemented in sql server). On the application side i will be building a web api on top of some complex domain models. I really want to utilize Entity Framework's code first approach, to maintain a clean domain model). Does anyone have a workable solution here that does not involve resorting back to stored procedures? Ideally I would like to somehow manipulate the sql generated by entity framework to wrap certain fields to do the sql encryption / decryption functions. </p>
  
  <p>Ideally , something like:</p>
  
  <pre><code>modelBuilder.Entity&lt;MyTable&gt;().ToTable("Table1").Property(p =&gt; p.SensativeData).encrypt("keyName",authenticatorFunc);
  </code></pre>