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

Update abstract repository documentation #220

Merged
merged 3 commits into from
Jan 13, 2022
Merged

Update abstract repository documentation #220

merged 3 commits into from
Jan 13, 2022

Conversation

KyleMcMaster
Copy link
Collaborator

Fixes #206

{
var spec = new HeroByNameSpec(name);

return await repository.GetBySpecAsync(spec);
Copy link
Owner

Choose a reason for hiding this comment

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

At this point in reading this I want to know what happens if there are 2 heroes with this same name...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

described how GetBySpecAsync would handle this above


public async Task<Hero> GetById(int id)
{
return await repository.GetByIdAsync(id);
Copy link
Owner

Choose a reason for hiding this comment

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

It's probably worth noting the type of repository somewhere in this section.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

updated

```csharp
public class HeroService
{
private readonly YourRepository<Hero> repository;
Copy link
Owner

Choose a reason for hiding this comment

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

I see it here. Normally I would make a private field _repository. In any case maybe show this line up above so folks know what type it is before getting here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

mentioned the field above and changed the field name

Copy link
Owner

@ardalis ardalis left a comment

Choose a reason for hiding this comment

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

Some changes requested

@ardalis ardalis merged commit 5d8b036 into ardalis:main Jan 13, 2022
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.

Docs: Using the built-in Abstract Repository
2 participants