Pregunta

My question is similar to this one but using Entity Framework 4.3.

Is it possible to refresh only one entity in entity framework [in any way]?

We are a big team working on a big database and usually I need to update just one part of the DB (the one I'm working on) as there are probably unfinished areas on it.

Any ideas?

¿Fue útil?

Solución

You can't. When you go to Refresh model VS read all objects and refresh it... it allways refresh all objects. One another solution are divide your table into several models, grouped by modules or some like that. Then, you can update just one model by time.

Otros consejos

yourObjectContext.Refresh(RefreshMode.StoreWins, <entity>);

If the entity to update contains somenavigational properties, they won't be refreshed as well. So you'll need to refresh them explicitly, if needed. I haven't worked with EF 4, and I have no idea on what your model mappings are, if there are eager/lazy loading etc. So, I think you might want to experiment a bit to determine whether only one entity is updated, or it's navigational properties are reloaded as well.

See ObjectContext.Refresh for details.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top