Пример #1
0
        public static IEnsuredAction Action(string actionId, Func <ActionState, AfterActionConfig> action)
        {
            if (!config.IsConfigured)
            {
                throw new ArgumentException("EnsureRunning requires configuring first to work");
            }
            if (!config.IsStorageConfigured)
            {
                throw new ArgumentException("EnsureRunning requires storage to be configured");
            }
            if (config.Storage == null)
            {
                throw new ArgumentException("Storage was null even after configuration. That suggest storage configuration took place but behaved unexpectidly and current action can't continue");
            }
            var ensuredActionConfig = new EnsuredActionConfig()
            {
                Action   = action,
                ActionId = actionId,
                Storage  = config.Storage
            };

            return(new EnsuredAction(ensuredActionConfig));
        }
Пример #2
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="config"></param>
 public EnsuredAction(EnsuredActionConfig config)
 {
     this.config = config;
 }