Developing for Tph, entity framework replaces delete insert with an update. How to turn it off

–1 vote
asked Mar 14, 2016 by RirMona (720 points) 1 flag
I want to remove row in database and insert it again with same Id, It sounds ridiculous, but here is scenario:The domain classes are as follows:public class SomeClass{ public int.

5 Answers

0 votes
answered Apr 26, 2016 by violet_6413 (810 points)

CRUD operations are done against the entity model using the rules set by EF. First, you need to realize that EF isn't simply a tool that replaces SQL.
In EF, however, you delete objects, not records.
0 votes
answered May 16, 2016 by updatedon (2,990 points)
Does this answer your question. Actually i believe that currently Zeeshan Hirani - Many To Many Mappings in Entity Framework is probably the best place
0 votes
answered May 17, 2016 by Fns_gaff (160 points)
You can check the details here as well Problem with Bulk insert using Entity Framework | Praneeth ... failed for one or more entities
And thus this is the best way
0 votes
answered May 28, 2016 by Fvg8483 (930 points)
Interestingly I had just watched a video about this before I saw your question
You can see here the remarks and example section there
0 votes
answered Jun 1, 2016 by urePure (480 points)
Just experienced this. I compared them, you can read more on The Entity Framework in Action | Entity Framework content ...
commented Jun 3, 2016 by v4756 (180 points)
For this example, you have the AddToCustomers and AddToOrders methods

What is Geekub?

Q&A site for professional and enthusiast programmers, software developers and other technical users. With your help, we hope to work together to build a library of detailed answers to just about any question that is related to programming!