public override ITransactionHandler FactoryOf(TransactionContext context, ServiceEntry serviceEntry, string serviceKey) { if (context == null) { var tccTransactionProvider = serviceEntry.GetTccTransactionProvider(serviceKey); if (tccTransactionProvider != null) { return(Handlers[TransactionRole.Start]); } return(null); } ITransactionHandler handler = null; switch (context.TransactionRole) { case TransactionRole.Participant: case TransactionRole.Start: handler = Handlers[TransactionRole.Participant]; break; default: handler = Handlers[TransactionRole.Consumer]; break; } return(handler); }