Question: I am using Entity Framework 1 with .net 3.5.

I am doing something simple like this:

```
var roomDetails = context.Rooms.ToList();

foreach (var room in roomDetails)
{        
   room.LastUpdated = DateTime.Now;
}

```

I am getting this error when I try to do:

```
 context.SaveChanges();

```

I get the error:

> 
> **Unable to update the EntitySet - because it has a DefiningQuery and no <UpdateFunction> element exists in the <ModificationFunctionMapping> element to support the current operation.**
> 
> 
> 

I am doing lots of updates on the context and not having any issues, it's only when I try to update this particular entity.

All my searching shows up the same thing, that there is no primary key declared on the entity that I'm trying to update. But alas, I do have a Primary key declared...

Answer: 
Just note that maybe your **Entity *have* primary key** but **your table in database *doesn't have* primary key**.
Adding the primary key worked for me too !

Once that is done, here's how to update the data model without deleting it -

Right click on the edmx Entity designer page and 'Update Model from Database'.