title: SortedList of an Entity in Entity Framework Code First
body: <p>I need to change a Many-to-Many relation ship in my project from List to a SortedList. I use Entity Framework 6 with Code First and Automatic Migration.</p>
  
  <p>We have a new requirement which is to have an ordered list. I thought it would be pretty simple but it seems like the migration does not take in account my modification.</p>
  
  <p>So I have to choose a alternative choice. So far I have some ideas but I'm not sure which is the best way.</p>
  
  <p>I could add a propriety in AnEntity :</p>
  
  <pre><code>public int order {get; set;}
  </code></pre>
  
  <p>But I dont like this idea because I can have AnEntity in several list. </p>
  
  <p>I could also make a new objet and change <code>List&lt;AnEntity&gt;</code> to <code>List&lt;AnEntityWithOrder&gt;</code></p>
  
  <pre><code>public abstract class AnEntityWithOrder
  {
      public int order {get; set;}
      public AnEntity AnEntity {get; set;}
  }
  </code></pre>
  
  <p>I'm wondering if their might be performance issues.</p>
  
  <p>At last I was wondering if It was possible to tell EF to create the ManyToMany table with an additionnal column for that order. Seems like it's not possible either. Do you know other ways for me to "simulate" this SortedList ???</p>