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

[User Story] As a developer, I want a singular repository class so that I can easily use multiple repositories #36

Open
nickmartin1ee7 opened this issue Dec 6, 2020 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@nickmartin1ee7
Copy link
Member

Given...
Multiple repositories are referenced within a method or class

When...
The need for accessing multiple repositories arises

Then...
Construct via factory, or pass in via DI a UnitOfWork class that contains all IRepositories to allow easy use of repositories.

  • This will become increasingly necessary when more repositories are created.
  • This is essentially containerizing repositories within a single class.

Acceptance Criteria:

  • Will have a UnitOfWork version containing multiple DALs.
  • Will have a FakeUnitOfWork version containing multiple FakeRepositories.
@nickmartin1ee7 nickmartin1ee7 added the enhancement New feature or request label Dec 6, 2020
@nickmartin1ee7
Copy link
Member Author

public class UnitOfWork : IUnitOfWork
{
  public IProjectRepository ProjectRepository { get; } = new ProjectDAL;
  public IMemberRepository MemberRepository { get; } = new MemberDAL;
}

public class FakeUnitOfWork : IUnitOfWork
{
  public IProjectRepository ProjectRepository { get; } = new FakeProjectRepository;
  public IMemberRepository MemberRepository { get; } = new FakeMemberRepository;
}

@nickmartin1ee7 nickmartin1ee7 added this to To do in Code2Gether-Discord-Bot via automation Jan 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants