Click here to Skip to main content
11,483,586 members (58,219 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C# WCF
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 27-Mar-13 5:44am
DinoRondelly at 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 at 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
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Entity framework self tracking is a kind of unit of work.
more link about ef and unit of work
Chamika Sandamal at 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.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

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

Smile | :)

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 305
1 Frankie-C 195
2 Raje_ 155
3 OriginalGriff 142
4 Abhipal Singh 108
0 Sergey Alexandrovich Kryukov 8,444
1 OriginalGriff 7,903
2 Sascha Lefèvre 3,114
3 Maciej Los 2,521
4 Richard Deeming 2,370

Advertise | Privacy | Mobile
Web03 | 2.8.150520.1 | Last Updated 3 Oct 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100