title: What is difference between dbcontext.Add and dbcontext.AddObject
body: <p>I am beginner at WPF. I want to know that what is difference between <code>dbcontext.Add</code> and <code>dbcontext.AddObject</code>. </p>
  
  <pre><code>private void AddButton_Click(object sender, RoutedEventArgs e)
  {
          Name employee = new Name();
          employee.Name1 = "Test";
          dataContext.Names.AddObject(employee);
  }
  </code></pre>
  
  <p>I want to achieve this <code>dbcontext.AddObject()</code>. But I get an error:</p>
  
  <blockquote>
    <p>'System.Data.Entity.DbSet' does not contain a definition for 'AddObject' and no extension method 'AddObject' accepting a first argument of type 'System.Data.Entity.DbSet' could be found (are you missing a using directive or an assembly reference?)   C:\Documents\Visual Studio 2012\Projects\WpfApplication9\WpfApplication9\MainWindow.xaml.cs 49  31  WpfApplication9`</p>
  </blockquote>
  
  <p>Also suggest which one is better. Thank you.</p>