title: Entity Framework doesn't open the certificate correctly
body: <p>I have a procedure to open a certificate, basically:</p>
  
  <pre><code>CREATE PROCEDURE [dbo].[SP_OPENCCKEY] WITH EXECUTE AS OWNER AS  
     OPEN SYMMETRIC KEY CCKEY
          DECRYPTION BY CERTIFICATE CERTCC;
  </code></pre>
  
  <p>And NO, I don't want to let my user open it directly.</p>
  
  <p>So, I'm trying to return a view wich uses that certificate to decrypt some of credit card data and i'm just doing like this:</p>
  
  <pre><code>public List&lt;VW_CREDITCARDS&gt; ListCreditCardByPersonID(int PersonId)
          {
              EntityMgr ent = new EntityMgr ();
              ent.ExecuteFunction("SP_OPENCCKEY");
              return ent.VW_CREDITCARDS.Where(p =&gt; p.PES_IDPERSON== PersonId).ToList();
          }
  </code></pre>
  
  <p>For some reason the results are returning NULL (probably because EF hasn't opened the key).</p>
  
  <p>Some hints?</p>