title: error when using interfaces for Entity Framework (4.2) entities
body: <p>I am using the the latest version of Entity Framework (4.2) and trying to implement interfaces for my Entities and for some reason, it isn't compiling. it is throwing an error "<code>Cannot convert expression type ICollection&lt;IOrder&gt; to return type ICollection&lt;Order&gt;</code>". if I don't use interfaces for the entities, then I don't get this error. </p>
  
  <p>I have a separate project for interfaces (for repositories and services etc) and I need to pass the EF entities in those methods as parameters and I don't want to pass the actual entities in them, because that will require the interface project to have a dependency on the EF entities.</p>
  
  <p>my goal is somewhat similar to the one mentioned in this post <a href="https://stackoverflow.com/questions/694761/can-i-abstract-entity-framework-away-from-my-entities">Can I abstract Entity Framework away from my Entities?</a></p>
  
  <p>here is the sample. I just put a sample here, my actual entities are different, but the problem is same.</p>
  
  <pre><code>public interface IOrder
  {
      int OrderId { get; set; }
      int CustomerId { get; set; }
      ICustomer Customer { get; set; }
  }
  
  public class Order : IOrder
  {
      public int OrderId { get; set; }
      public int CustomerId { get; set; }
      ICustomer Customer { get; set; }
  }
  
  public interface ICustomer
  {
      int CustomerId { get; set; }
      ICollection&lt;IOrder&gt; Orders { get; set; }
  }
  
  public class Customer : ICustomer
  {
      public int CustomerId { get; set; }
      ICollection&lt;IOrder&gt; Orders { get; set; }
  }
  
  public class OrderMap : EntityTypeConfiguration&lt;Order&gt;
  {
      this.HasOptional(t =&gt; t.Customer)
      .WithMany(t =&gt; t.Orders) //error comes from this line
      .HasForeignKey(d =&gt; d.CustomerId);
  }
  </code></pre>