Exemple #1
0
        public static RulesDto FromRules(IEnumerable <IRuleEntity> items, ApiController controller, string app)
        {
            var result = new RulesDto
            {
                Items = items.Select(x => RuleDto.FromRule(x, controller, app)).ToArray()
            };

            return(result.CreateLinks(controller, app));
        }
Exemple #2
0
        public static RulesDto FromRules(IEnumerable <IEnrichedRuleEntity> items, Guid?runningRuleId, Resources resources)
        {
            var result = new RulesDto
            {
                Items = items.Select(x => RuleDto.FromRule(x, runningRuleId, resources)).ToArray()
            };

            result.RunningRuleId = runningRuleId;

            return(result.CreateLinks(resources, runningRuleId));
        }
Exemple #3
0
        public static RulesDto FromRules(IEnumerable <IEnrichedRuleEntity> items, Guid?runningRuleId, ApiController controller, string app)
        {
            var result = new RulesDto
            {
                Items = items.Select(x => RuleDto.FromRule(x, runningRuleId, controller, app)).ToArray()
            };

            result.RunningRuleId = runningRuleId;

            return(result.CreateLinks(controller, runningRuleId, app));
        }
Exemple #4
0
        public static async Task <RulesDto> FromRulesAsync(IEnumerable <IEnrichedRuleEntity> items, IRuleRunnerService ruleRunnerService, Resources resources)
        {
            var runningRuleId = await ruleRunnerService.GetRunningRuleIdAsync(resources.Context.App.Id);

            var result = new RulesDto
            {
                Items = items.Select(x => RuleDto.FromRule(x, runningRuleId == null, ruleRunnerService, resources)).ToArray()
            };

            result.RunningRuleId = runningRuleId;

            return(result.CreateLinks(resources, runningRuleId));
        }