Skip to main content

All Questions

-1 votes
3 answers
873 views

Would Injecting dependencies in C# as default parameters be a bad practice?

Given the (old) debate over whether Singletons are overused/abused/are worth it - would it be a bad idea to inject the dependencies as default parameters? In this way, we could get rid of defining ...
Veverke's user avatar
  • 491
18 votes
4 answers
6k views

Should injecting dependencies be done in the ctor or per method?

Consider: public class CtorInjectionExample { public CtorInjectionExample(ISomeRepository SomeRepositoryIn, IOtherRepository OtherRepositoryIn) { this._someRepository = ...
StuperUser's user avatar
  • 6,163