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

Return IServiceCollection instead of void in ServiceCollectionExtensions #34

Merged
merged 1 commit into from
Jul 5, 2024

Conversation

Twinki14
Copy link
Contributor

@Twinki14 Twinki14 commented Jul 1, 2024

Motivations

Returning the IServiceCollection allows for clean chaining of Add.. calls, which can be a popular pattern when configuring DI for many, like so

services
    .AddDiscordHost()
    .AddCommandService()
    .AddInteractionService()

Modifications

  • Return the IServiceCollection instead of void
  • Add some commas to places in the comments, for grammar-sake

Extra

Just wanted to thank you so much for this package, not just for the original implementation but also for maintaining it with the dotnet Host standards that continue to evolve

…ad of `void`

# Motivations
Returning the `IServiceCollection` allows for clean chaining of `Add..` calls, like so

```
services
    .AddDiscordHost()
    .AddCommandService()
    .AddInteractionService()

```

# Modifications
- Return the `IServiceCollection` instead of `void`
- Add some commas to places in the comments, for grammar-sake
@Twinki14 Twinki14 changed the title Return IServiceCollectioninstead of void in ServiceCollectionExtensions Return IServiceCollection instead of void in ServiceCollectionExtensions Jul 1, 2024
Copy link
Owner

@Hawxy Hawxy left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution!

@Hawxy Hawxy merged commit 23acffb into Hawxy:master Jul 5, 2024
1 check passed
@Twinki14 Twinki14 deleted the return-service-collection branch July 8, 2024 20:26
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.

2 participants