title: .Net Framework 4.5 AddObject() does not appear
body: <p>I have a class that I want to make <code>Insert</code>, <code>Update</code>, <code>Delete</code> operations in it.</p>
  
  <pre><code>// Constructor.
  public BaseManager()
  {
      // Disable lazy loading.
      this.Context.Configuration.LazyLoadingEnabled = false;
  }
  
  public DBEntities Context = new DBEntities();
  </code></pre>
  
  <p>In this class, I can't use <code>AddObject()</code> extension method on <code>Context</code> variable. <code>AddObject()</code> method does not appear typing after <code>Context.</code></p>
  
  <p>Here are my imported namespaces:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Data.Linq;
  using System.Text;
  </code></pre>
  
  <p>I was able to use it in .Net Framework 3.5 but not working on .Net Framework 4.5</p>
  
  <p>What I've doing wrong?</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>Importing <code>using System.Data.Entity;</code> or <code>using System.Data.Objects;</code> not working.</p>
  
  <p>Here is the method I want to use: <a href="http://msdn.microsoft.com/en-us/library/system.data.objects.objectcontext.addobject.aspx">http://msdn.microsoft.com/en-us/library/system.data.objects.objectcontext.addobject.aspx</a></p>
  
  <p><strong>UPDATE AGAIN:</strong></p>
  
  <p>I realized that my DBEntities derives from <code>DbContext</code> in .Net Framework 4.5 but it was deriving from <code>ObjectContext</code> in .Net Framework 3.5, so I was able to use <code>AddObject()</code> method.</p>
  
  <p>Original entities class:</p>
  
  <pre><code>public partial class DBEntities : DbContext
      {
          // ...
      }
  </code></pre>
  
  <p>I want to do like this:</p>
  
  <pre><code>public partial class DBEntities : ObjectContext
      {
          // ...
      }
  </code></pre>
  
  <p>If I change base class from <code>DbContext</code> to <code>ObjectContext</code> does it constitute any problem?</p>