Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor UnitOfWork to use DbContext Instead of IDataContext #18

Merged
merged 3 commits into from
Oct 23, 2017

Conversation

tonysneed
Copy link
Collaborator

Note: This is a substantial refactoring that addresses the following issues:

  • IDataContext duplicates IUnitOfWork and should be deprecated.
  • UnitOfWork should not implement IDisposable, because DbContext is disposed via IoC by Web API.
  • Repository is responsible for calling ApplyChanges (via Trackable Entities) to inform DbContext of changes.
  • The **Graph methods are obsolete because Trackable Entities does graph traversal.

@lelong37 We'll do a code review of these changes. I'll also need help standing up the sample app.

Anthony Sneed added 3 commits October 20, 2017 19:39
Refactor UnitofWork to use DbContext.
- Note: Tests need to mock DbContext.
- Make Reporitory fields protected.
- Add FakeRepository and FakeUnitOfWork to Tests.
- Add ApplyChanges to IRepository, IService.
- Update integration tests.
- Change db name to NorthwindTestUrf.
@tonysneed tonysneed merged commit 5a5f074 into master Oct 23, 2017
tonysneed pushed a commit that referenced this pull request Oct 23, 2017
@tonysneed tonysneed deleted the refactor-data-context branch October 23, 2017 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant