Scope providers and using DI containers that have no constructor parameter override.

13 views
Skip to first unread message

Pete Roberts

unread,
Aug 7, 2018, 9:23:17 AM8/7/18
to masstransit-discuss
Hello,  

I've been looking at the various container extensions in the Mass Transit source as I am attempting to integrate our custom DI container in the same way.

In most cases, ActivityScopeProviders and CompensateActivityScopeProviders persist features of the passed-in context (the TLog member in the case of the latter for example)  This is done using whatever constructor parameter override facility the container provides.
However, in the case of the ExtensionsDIIntegration, a new object is resolved from the container and it looks like nothing is passed into it from the passed-in argument.

I'm struggling to understand if this is ok or not.  Our container doesn't have any parameter override facility, so I would copy this behaviour if I could understand why it isn't an error.

Many thanks,
Pete

Chris Patterson

unread,
Aug 7, 2018, 10:11:02 AM8/7/18
to masstrans...@googlegroups.com
Each container is different, so you do implement what is supported. For instance, MS DI doesn't allow instances to be added to a newly created scope, which sucks, but it is what it is.

--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-discuss+unsub...@googlegroups.com.
To post to this group, send email to masstransit-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/26efc1aa-00f8-47f3-ba6b-e2491b34222f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Pete Roberts

unread,
Aug 8, 2018, 6:51:15 AM8/8/18
to masstransit-discuss
Hi, Chris,

Thanks for your reply.  I'll look again and try to understand the implications of this.

thanks,
Pete

On Tuesday, August 7, 2018 at 3:11:02 PM UTC+1, Chris Patterson wrote:
Each container is different, so you do implement what is supported. For instance, MS DI doesn't allow instances to be added to a newly created scope, which sucks, but it is what it is.
On Tue, Aug 7, 2018 at 8:23 AM, Pete Roberts <peterob...@gmail.com> wrote:
Hello,  

I've been looking at the various container extensions in the Mass Transit source as I am attempting to integrate our custom DI container in the same way.

In most cases, ActivityScopeProviders and CompensateActivityScopeProviders persist features of the passed-in context (the TLog member in the case of the latter for example)  This is done using whatever constructor parameter override facility the container provides.
However, in the case of the ExtensionsDIIntegration, a new object is resolved from the container and it looks like nothing is passed into it from the passed-in argument.

I'm struggling to understand if this is ok or not.  Our container doesn't have any parameter override facility, so I would copy this behaviour if I could understand why it isn't an error.

Many thanks,
Pete

--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-discuss+unsub...@googlegroups.com.
To post to this group, send email to masstrans...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages