3
votes
Accepted
Autofac support for connection strings
It appears the goal here is to provide parameters to a resolve operation using a different format, something string-based. This appears to be primarily useful in a service location (manually executing ...
3
votes
Accepted
Using constructor dependency injection in a custom mapper class
Per my understanding: are you trying to use ContainerStatusGetter as an AggregateRoot? If so, then you need an AggregateRepository that get the IDateTime service from the constructor, and has a ...
2
votes
Should I get Autofac to include classes that don't have a public constructor?
Let's take a look on your code:
...
2
votes
Accepted
Should I get Autofac to include classes that don't have a public constructor?
Generally speaking, classes with private-only constructors are irrelevant in terms of DI. It makes no sense to include them in your container because the container can't do anything with them.
The ...
2
votes
Accepted
Registering Named services and resolving them by T
Your solution is sane, and it can easily be extended to a generic extension method. Last() is the best you can do. It would have been better if ...
2
votes
Allowing query handlers to use other query handlers
I have the complete opposite view. Every query is specific to its use case. Today it may be true that you can call the other query but if someone changes its output then your query could be impacted....
1
vote
Autofac support for connection strings
GitHub and NuGet
The right way would be to do not depend on Autofac but support it through AutofacSeriveProvider as many other ...
1
vote
Registering Named services and resolving them by T
I'm not into that whole brevity thing, so I like longer variable names, even for lambda expressions. Plus I like method chaining over query comprehension syntax. I'm weird like that. So the big wiring ...
1
vote
Accepted
Using Autofac to do DI in a static factory method
What are you registering CommandLineTokenizer etc for? this whole code block is equivalent to
return new CommandLineExecutor(logger);
If all these types are ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
c# × 16autofac × 16
dependency-injection × 9
entity-framework × 5
repository × 2
moq × 2
.net × 1
unit-testing × 1
database × 1
asp.net × 1
reflection × 1
asp.net-core × 1
factory-method × 1
asp.net-web-api × 1
static × 1
asp.net-mvc-5 × 1
transactions × 1