title: c# Entity Framework - Generics solution
body: <p>Is there a generics solution for the following code?</p>
  
  <pre><code>public static int SaveReorder(IList&lt;int&gt; listItems)
      {
          int result = 0;
          int order = 1;
          Entity1 db = null;
  
          using (ObjectContext context = new ObjectContext())
          {
              foreach (int id in listItems)
              {
                  db = Get(context, id);
                  db.Order = order;
                  context.SaveChanges();
                  order += 1;
              }
              result = 1;
          }
          return result;
      }
  </code></pre>
  
  <p>listItems contains an ordered sequence of identitykeys. 
  Entity1 is one of the EntityObjects from our EDM.
  Get(...) is a custom method in the same class to get an EntityObject on basis of the current ObjectContext and by Id.</p>
  
  <p>We want a generic solution for this implementation so we can apply this for several EntityObjects, where the property 'Order' is a common property for all the EntityObjects. Is this possible?</p>