All Questions
2 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 ...
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 = ...