Click here to Skip to main content
15,896,912 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
What is the difference between using Entity framework self tracking entities and implementing Unit of work architecture? As i understand both are keep tracking of the objects, one db call for commit changes. So i cant figure out the difference of those. can some one point me about what should used in which case?
I'm using entity framework 5 with WCF service application.
Posted
Comments
DinoRondelly 27-Mar-13 14:15pm    
You should use google and investigate on your own. The pros and cons of each should be readily available through a well formatted search. I mean unless you want a bunch of links from someone else who does the search for you.
Chamika Sandamal 27-Mar-13 14:24pm    
So you think i'm just asking questions without searching? nop man i searched but i haven't found a valid information as i expected. that's why i ask this question

Entity framework self tracking is a kind of unit of work.
more link about ef and unit of work
http://stackoverflow.com/questions/6843006/is-unit-of-work-pattern-required-in-entity-framework-4-0
http://stackoverflow.com/questions/7940854/is-unit-of-work-and-repository-patterns-very-useful-for-big-projects#7941017
 
Share this answer
 
v2
Comments
Chamika Sandamal 28-Mar-13 7:47am    
yes i know that self tracking is kind of unit of work. that is why i'm asking any purpose of using unit of work instead of self tracking entities.
I have find out your response it is very clear to understand the answer:
1- They are the same when you look thir purpose because they will aply the changes all together to the databse
2- You can prefere Self Tracking because: Self Tracking simply ready to use with a variety of working capasity (Because it has many implemented methods)
3- You can prefere UnitOfWork because: You can add your methods according to your needs as like as RoleBack but also you can add those to the selftracking if you agree current implementation

:)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900