Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class FooService : IFooService
- {
- private DomainContext db;
- public FooService(DomainContext db)
- {
- this.db = db;
- }
- public void MergeEntities(Entity source, Entity target)
- {
- using (var uow = db.Database.BeginTransaction())
- {
- // merge source into target
- db.SaveChanges();
- uow.Commit();
- }
- }
- }
- public class FooService : IFooService
- {
- private DomainContext db;
- public FooService(DomainContext db)
- {
- this.db = db;
- }
- public void MergeEntities(Entity source, Entity target)
- {
- // merge source into target
- db.SaveChanges();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement