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

UoW #1

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

UoW #1

wants to merge 10 commits into from

Conversation

Pakoke
Copy link

@Pakoke Pakoke commented Jun 8, 2018

don´t be afraid!!
I know that I change a lot of things, I just want to discuss all those changes and merge, if you like the changes that you agree.
To sum up, I add you the UoW functionality, GenericRepository and improve the implementation, change the unit test and unify stub repository. Granulate the business logic instead, we replace the same functionality from the data access to the business logic.

private readonly IPeopleRepository _peopleRepository;
public PeopleAdderService(IPeopleRepository peopleRepository)
private readonly IGenericUoW _uow;
public PeopleAdderService(IGenericUoW uow)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to use the generic uow


Core.Entities.EF.Person person = null;
Core.Entities.EF.Store store = null;
if (customer.PersonId != null)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apply the same behaviour that the data access do. Allow you to control which queries to use.
With a simple view of the logic allow you to realize which object compose a CustomerDTO and allow you in a future to remove or add an unnecessary functionality.


IEnumerable<TEntity> FindBy(Expression<Func<TEntity, bool>> predicate);
TEntity GetById(string id);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add common methods instead of add the same method in every particular repository

@@ -0,0 +1,75 @@
using AdventureWorks.Core.Interfaces.Persistance;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename the class Repository.cs to a GenericRepository.cs

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