Exemplo n.º 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));
        }
Exemplo n.º 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));
        }
Exemplo n.º 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));
        }
Exemplo n.º 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));
        }