This is a migrated thread and some comments may be shown as answers.

Re-Add deleted entity

2 Answers 45 Views
Data Access Free Edition
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
S
Top achievements
Rank 1
S asked on 24 Mar 2015, 04:02 AM
I deleted an entity and intend to add it back. Unfortunately, I couldn't get it back by trying from "Update From Database".

When I made changes to the actual table, I can trigger see the table. After the update, I can't find the entity. My code now complaints for the non-existence of the entity.

Please help 

2 Answers, 1 is accepted

Sort by
0
S
Top achievements
Rank 1
answered on 24 Mar 2015, 05:40 AM
Is good now. I got it solved
0
Yavor Slavchev
Telerik team
answered on 26 Mar 2015, 03:58 PM
Hi,
I'm glad to hear from you that the issue you were facing is now resolved.

However, I want to clarify this behavior to let you understand how database mapping works more clearly.
When you delete an entity from the designer, it is actually deleted only as a type and not as an relation item from the model schema.The Model schema is used as a starting point when updating the model form the database, i.e. when the model is updated from database, it compares database objects (tables, views, etc) with the items from the model schema.
In your case, when you deleted the entity from the designer, you actually delete it only from the domain model and the table in the model schema explorer still exists. When you delete the table from Model Schema Explorer, then the next time you execute "Update From Database" the missing entity will be tracked as new and will be added to the designer.
You can take a look at this article for more information how to track database changes and how to delete entities.

I hope this information is helpful.

Regards,
Yavor Slavchev
Telerik
 
OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
 
Tags
Data Access Free Edition
Asked by
S
Top achievements
Rank 1
Answers by
S
Top achievements
Rank 1
Yavor Slavchev
Telerik team
Share this question
or