views:

98

answers:

2

Hi,

I have created my own entities in edmx i.e. temp table for a stored procedure. Now when i update my EDMX and adds or update any table, the entity which i created (for temp table) is removed from SSDL portion.

Is there any way that my changes are not lost. Mean can extend EDMX or any other way.....

Thanks...

+1  A: 

This is a known problem of Update model from database wizard. All manual changes in the model are discarded.
It was not fixed in VS 2010 RTM.

Devart
That's not right. Changes in SSDL (only!) are discarded *if* they're a part of the SSDL which the wizard *could* generate. Tables are supported in the wizard, so they'll be regenerated. If you drop a (temp or other) table from a DB, it will be removed from the model. That's not a bug; it's a feature.
Craig Stuntz
Craig Stuntz: U are correct to say that if table is removed from the DB then it is removed from SSDL portion. For a time consider this example: I have added <OnDelete Action="Cascade"></OnDelete> on my association. Next time if i update the model from DB my this association is delete, and i have to again write this. Like this i have created 3 temp entity in my EDMX. Now if i update my model my temp entities are delete. I don't want to happen this. I want to save these changes.Yes this a bug/featurte in entity framework. But there should be solution(feature), if i dont want to do this.
Waheed
The only bug here is that you mapped a temp table, IMHO. Just don't do that.
Craig Stuntz
A: 

Continuation to this thread after a long time... but its a real problem. For a moment, suppose we are using EF for connection to Oracle database. Insertion into a table can be done using StoredGeneratedPattern="Identity". Now, if the model is regenerated all the statements written will be lost. This is really a problem and there should be a solution for this problem.

Ravi