public static StatelessBuilder UseLiteDBStorage(this StatelessBuilder source, string connectionString = null)
        {
            if (source.Services == null)
            {
                return(source);
            }

            source.Services.AddScoped <IStateMachineContextStorage>(sp => new LiteDBStateMachineContextStorage(connectionString));
            source.Services.AddScoped <IStateMachineContentStorage>(sp => new LiteDBStateMachineContentStorage(connectionString));

            return(source);
        }
        public static IServiceCollection AddStateless(
            this IServiceCollection services,
            Action <StatelessBuilder> builderAction = null)
        {
            if (services == null)
            {
                return(services);
            }

            services.AddScoped <ITransitionDispatcher, TransitionDispatcher>();
            AddStatemachineHandlers(services);

            var builder = new StatelessBuilder(services);

            builderAction?.Invoke(builder);

            return(services);
        }