-
Notifications
You must be signed in to change notification settings - Fork 1
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
base: master
Are you sure you want to change the base?
UoW #1
Conversation
…layer into the bussines logic layer getting more granularity. Change the repository into a more generic repository to avoid redundancy.
UoWandGeneric
private readonly IPeopleRepository _peopleRepository; | ||
public PeopleAdderService(IPeopleRepository peopleRepository) | ||
private readonly IGenericUoW _uow; | ||
public PeopleAdderService(IGenericUoW uow) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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
…equest entites to document the swagger api.
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.