Пример #1
0
        private void SetFreeActions()
        {
            FreeAction _freeAction = _cache.GetData <FreeAction>("FreeActions");

            if (_freeAction == null || (DateTime.Now.Subtract(_freeAction.created_at).Hours >= 24))
            {
                _freeAction = new FreeAction();
                Query       = new QueryParam()
                {
                    Table  = typeof(Actions).GetTableName(),
                    Fields = "distinct service_url",
                    Where  = new List <ConditionParameter> {
                        Condition("is_free", true),
                        new ConditionParameter {
                            direct_condition = "service_url is not null", PropertyValue = "#$#", PropertyName = "service_url"
                        }
                    }
                };
                _freeAction.actions    = NewRepo.FindAll <string>(Query).ToList();
                _freeAction.created_at = DateTime.Now;
                _cache.SaveData(_freeAction, "FreeActions", null);
            }
        }