Skip to content

Update abstract repository documentation - #220

Merged
ardalis merged 3 commits into
ardalis:mainfrom
KyleMcMaster:docs/abstract-repository
Jan 13, 2022
Merged

Update abstract repository documentation#220
ardalis merged 3 commits into
ardalis:mainfrom
KyleMcMaster:docs/abstract-repository

Conversation

@KyleMcMaster

Copy link
Copy Markdown
Collaborator

Fixes #206

{
var spec = new HeroByNameSpec(name);

return await repository.GetBySpecAsync(spec);

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

Comment thread docs/usage/use-built-in-abstract-repository.md Outdated

@ardalis ardalis left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Some changes requested

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