-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add transient service provider package #16
base: main
Are you sure you want to change the base?
Conversation
/// <summary> | ||
/// Provides a transient service provider that delegates service resolution |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the provider now
/// <param name="serviceType">The type of service to resolve.</param> | ||
/// <returns>The requested service instance or null if not found.</returns> | ||
public object? GetService(Type serviceType) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just inheritdoc?
Also, I believe this could use the following form:
object? IServiceProvider.GetService(Type serviceType)
for additional clarity regarding what this does and why it is here
@@ -2,6 +2,11 @@ | |||
|
|||
namespace BitzArt.DependencyInjection; | |||
|
|||
/// <summary> | |||
/// Factory for creating and managing transient service providers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does not seem like this brings anything new to the table, while this class could use some explanation
public static class ServiceCollectionExtensions | ||
{ | ||
/// <summary> | ||
/// Registers the factory as a singleton and adds a transient registration that retrieves a provider from the factory. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary for the package's user to know how exactly the factory and the providers are registered under the hood (singleton / transient, etc.)?
I believe this could use additional explanation on how the factory and the providers are connected. Consider adding something like the following:
/// Registers an <see cref="TransientServiceProviderFactory"/>
and referring to the TransientServiceProvider
somewhere in a similar fashion.
This could give the reader a way to figure out more about each of these classes by clicking their respective links in the summary here.
b05e663
to
dce9982
Compare
No description provided.