© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
11 replies
Thinker

✅ Allowing option of using dependency injection

I'm working on a small-ish project, mostly for personal use. I have a 'core' type called
ILazyGenerator
ILazyGenerator
and a corresponding
ILazyGeneratorBuilder
ILazyGeneratorBuilder
type, both with 'default' concrete implementations in the same project. These default concrete types or interface don't inherently provide any support for dependency injection, but in the slim case that someone else who maybe eventually possibly perhaps is going to use my library wants dependency injection, I might want to support that. However, I really want to keep this initial project relatively small and simple, and not have to bring in huge packages like MS.Ext.DI. So there are two possibilities I'm considering: either I have the interfaces a mess of generics which provide support for generic context objects everywhere, or I just bite the bullet and include standard support for DI using MS.Ext.DI in the base library. Obviously the latter is easily the simpler of the two, however I still would like some feedback.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Purpose of Dependency Injection
C#CC# / help
2y ago
Dependency injection
C#CC# / help
6mo ago
✅ Dependency injection
C#CC# / help
2y ago
❔ Dependency Injection
C#CC# / help
3y ago