/// <summary>
        /// Преобразование объекта правила из БД в правило процессинга
        /// </summary>
        /// <param name="rule">Объект правила из БД</param>
        /// <returns></returns>
        public static ProcessingRule Cast(this Rule rule)
        {
            ProcessingRule processingRule = new ProcessingRule();
            processingRule.Id = rule.Id;
            processingRule.ActivateBonusInDays = rule.ActivateBonusInDays;
            processingRule.ActivateInDate = rule.ActivateInDate;
            processingRule.ActivateOnCharge = rule.ActivateOnCharge;
            processingRule.BonusLifeTime = rule.BonusLifeTime;
            processingRule.ChargeAmount = rule.ChargeAmount;
            processingRule.ChargePercent = rule.ChargePercent;
            processingRule.ExpiredIn = rule.ExpiredIn;
            processingRule.LifeTimeFrom = rule.LifeTimeFrom;
            processingRule.LifeTimeTo = rule.LifeTimeTo;
            processingRule.Production = rule.Production;
            processingRule.Sandbox = rule.Sandbox;
            processingRule.Priority = rule.Priority;
            processingRule.Name = rule.Name;

            var serializer = ProcessingEngine.Instance.Container.Resolve<ISerializer>();
            processingRule.Conditions = serializer.Deserialize<ConditionGroup>(rule.Conditions);
            processingRule.LocalActions = serializer.Deserialize<List<LocalActionBase>>(rule.LocalActions);
            processingRule.LocalRestrictions = serializer.Deserialize<List<LocalRestrictionBase>>(rule.LocalRestrictions);

            return processingRule;
        }
 public static string GetLocalRestrictionsConfig(ProcessingRule rule)
 {
     var serializer = ProcessingEngine.Instance.Container.Resolve<ISerializer>();
     return serializer.Serialize(rule.LocalRestrictions);
 }