Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2014
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. public class FooService : IFooService
  2. {
  3. private DomainContext db;
  4.  
  5. public FooService(DomainContext db)
  6. {
  7. this.db = db;
  8. }
  9.  
  10. public void MergeEntities(Entity source, Entity target)
  11. {
  12. using (var uow = db.Database.BeginTransaction())
  13. {
  14. // merge source into target
  15.  
  16. db.SaveChanges();
  17.  
  18. uow.Commit();
  19. }
  20. }
  21. }
  22.  
  23. public class FooService : IFooService
  24. {
  25. private DomainContext db;
  26.  
  27. public FooService(DomainContext db)
  28. {
  29. this.db = db;
  30. }
  31.  
  32. public void MergeEntities(Entity source, Entity target)
  33. {
  34. // merge source into target
  35.  
  36. db.SaveChanges();
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement