title: Entity Framework Code First and explicit interfaces
body: <p>Here's what I'm trying to accomplish:</p>
  
  <p>Some entities should be "soft deleted," so I'd like to add a field (and respective column) called "IsDeleted."  I'd like this property to be accessible only to the DAL (which can be accomplished via friend assemblies).  I'd also like it if the DAL could treat all of these entities the same, via an interface (IDeletable). </p>
  
  <p>To accomplish both goals, I can make IDeletable an internal interface and in classes implementing this interface I can make use of explicit interfaces:</p>
  
  <pre><code>bool IDeletable.IsDeleted { get; set; }
  </code></pre>
  
  <p>The DAL code would probably look something like this:</p>
  
  <pre><code>public void Delete&lt;T&gt;(T entity)
  {
      var d = entity as IDeletable;
      if(d != null)
         //soft delete
         d.IsDeleted = true;
      else
         //hard delete
  
      //....
   }
  </code></pre>
  
  <p>The problem is that EF Code First has no way of generating the columns, as far as I can tell.  I've tried using expressions, but it complains when I try casting to IDeletable.  </p>
  
  <p>Is there a way to force EF Code First to create columns, without expressions?</p>