Skip to content

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

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