title: Entity Framework 4.1 Invalid object name
body: <p>I am getting the following error in Entity Framework and cannot for the life of me figure out what is causing it.  </p>
  
  <p>Invalid object name 'dbo.User’</p>
  
  <p>The actual table name in the database is called Users and I added it to my Entity Model by right clicking and selecting ‘Update Model From Database’ I have around six other models in my project all connecting to the same database which have pluralised table names and are updated in exactly the same way without any problems. It seems for some reason EF removes the ‘s’ from my table name when trying  to perform an update. As you can see from my code below I perform a selection before the update which works without problem. </p>
  
  <p>I have also tried deleting the entity and recreating it unchecking the ‘Pluralize or singularize generated object names’. However the problem remains.</p>
  
  <p>Any ideas would be appreciated on this one.</p>
  
  <pre><code>public void Update(User updatedUser)
  {
      using (var context = CreateUserContext())
      {
          var entity = context.UserEntities
              .Where(u =&gt; u.UserId == updatedUser.UserId)
              .SingleOrDefault();
  
          if (entity != null)
          {
              entity.Name = updatedUser.Name;
              entity.Description = updatedUser.Description;
              entity.LastModifiedById = updatedUser.LastModifiedById;
              entity.IsDeleted = updatedUser.IsDeleted;
  
              context.UserEntities.ApplyCurrentValues(entity);
              context.SaveChanges();
          }
      }
  }
  </code></pre>