title: Why am I getting a "Unable to update the EntitySet because it has a DefiningQuery..." exception when trying to update a model in Entity Framework?
body: <p>While updating with the help of LINQ to SQL using Entity Framework, an exception is thrown.</p>
  
  <pre><code>System.Data.UpdateException: Unable to update the EntitySet 't_emp' because it has 
  a DefiningQuery and no &lt;UpdateFunction&gt; element exists in the   
  &lt;ModificationFunctionMapping&gt;
  </code></pre>
  
  <p>The code for update is :</p>
  
  <pre><code>public void Updateall()
      {
          try
          {
  
  
              var tb = (from p in _te.t_emp
                        where p.id == "1"
                        select p).FirstOrDefault();
              tb.ename = "jack";
  
              _te.ApplyPropertyChanges(tb.EntityKey.EntitySetName, tb);
              _te.SaveChanges(true);
          }
          catch(Exception e)
          {
  
          }
      }
  </code></pre>
  
  <p>Why am I getting this error?</p>