Dependency Injection #271
-
Is there a sample or docs that shows how DI works/setup with a domainService in .net framework 4.7.2 using something like autofac or ninject |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The general approach to implement DI is to implement the IDomainServiceFactory interface.
If you need to store some additional state (such as a scope/context that needs to be disposed in the release method) I find that the easiest approach is to add it to a interface that all your services implement. Samples:
If you create a sample it would be very appreciated it you would submit it to the samples repository. |
Beta Was this translation helpful? Give feedback.
The general approach to implement DI is to implement the IDomainServiceFactory interface.
If you need to store some additional state (such as a scope/context that needs to be disposed in the release method) I find that the easiest approach is to add it to a interface that all your services implement.
You might also be able to use OperationContext.Current.Extensions to store additional information
Samples:
If you cr…