public RuleVaultDTO(RuleVault rule) { RuleId = rule.RuleId; OwnerId = rule.OwnerId; Tag = rule.Tag.ToString(); KeyId = rule.KeyId; Condition = rule.Condition; Action = rule.Action.ToString(); }
public RuleConditionEval(RuleVault rule) { if (string.IsNullOrWhiteSpace(rule.Condition)) { this.query = "false"; } else if (rule.Condition.ToLower() == "true" || rule.Condition.ToLower() == "false") { this.query = rule.Condition; } else { this.query = GetQuery(JsonSerializer.Deserialize <List <RuleCondition> >(rule.Condition, new JsonSerializerOptions { PropertyNameCaseInsensitive = true })); } }