public IDeactivationTransactionalState <TState> Create <TState>(IDeactivationTransactionalStateConfiguration config) where TState : class, new()
        {
            TransactionalState <TState>             transactionalState             = ActivatorUtilities.CreateInstance <TransactionalState <TState> >(this.context.ActivationServices, config as ITransactionalStateConfiguration, this.serializerSettings, this.context);
            DeactivationTransactionalState <TState> deactivationTransactionalState = ActivatorUtilities.CreateInstance <DeactivationTransactionalState <TState> >(this.context.ActivationServices, transactionalState, this.context);

            deactivationTransactionalState.Participate(context.ObservableLifecycle);
            return(deactivationTransactionalState);
        }
        public Factory <IGrainActivationContext, object> GetFactory(ParameterInfo parameter, DeactivationTransactionalStateAttribute attribute)
        {
            IDeactivationTransactionalStateConfiguration config = attribute;
            // use generic type args to define collection type.
            MethodInfo genericCreate = create.MakeGenericMethod(parameter.ParameterType.GetGenericArguments());

            object[] args = new object[] { config };
            return(context => Create(context, genericCreate, args));
        }