title: How to add a new entity to a domain context and immediately see it in data bound controls before SubmitChanges?
body: <p>I've got a Silverlight 4 RIA Services (SP1) app using Entity Frameworks 4 CTP5. I can databind a grid or listbox to the IEnumerable loaded by the domain context and it shows data from the server.  Great.</p>
  
  <p>Now I want to create a new instance of MyEntity and add it to the client-side data so that the user can see the newly added entity.  MyEntity is a true entity descendant, not a POCO.</p>
  
  <p>The only Add method I can find is <code>domainContext.EntityContainer.GetEntitySet&lt;MyEntity&gt;().Add(newobj)</code>  </p>
  
  <p>This does add the new entity to the domain context, and the domainContext.HasChanges does become true, but the new entity doesn't show up in the databound controls.</p>
  
  <p>How do I get the new entity to show up in the databound controls prior to SubmitChanges?</p>
  
  <p>(Probably related to <a href="https://stackoverflow.com/questions/1423840/programmatically-add-row-to-entity-data-model-context-and-have-new-row-show-up-in">this</a> SO question from years ago that never got an answer)</p>
  
  <p>Here's the server side declarations of the domain service, per requests:</p>
  
  <pre><code>[EnableClientAccess()]
  public class MyDomainService : LinqToEntitiesDomainService&lt;MyObjectContext&gt;
  {
      protected override MyObjectContext CreateObjectContext()
      {
          return new MyObjectContext();
      }
  
      public IQueryable&lt;MyEntity&gt; GetMyEntities()
      {
          return this.ObjectContext.MyEntities;
      }
  
      public void InsertMyEntity(MyEntity MyEntity)
      {
          // ...
      }
  
      public void UpdateMyEntity(MyEntity currentMyEntity)
      {
          // ...
      }
  
      public void DeleteMyEntity(MyEntity MyEntity)
      {
          // ...
      }
  }
  </code></pre>