示例#1
0
 public async Task <RuleSummary[]> Rules()
 {
     return(_messageRuleService
            .GetAll(r => r.Filters, r => r.Actions)
            .OrderBy(r => r.Name)
            .ToList()
            .Select(r => _mapper.Map <RuleSummary>(r))
            .ToArray());
 }
        public async Task <ActionResult <IEnumerable <MessageRuleViewModel> > > Index()
        {
            try
            {
                var all = await _messageRuleService.GetAll();

                var transformed = new List <MessageRuleViewModel>();
                foreach (var component in all)
                {
                    var transform = await _presenter.Present(component);

                    transformed.Add(transform);
                }

                return(Ok(transformed));
            }
            catch (Exception debug)
            {
                return(StatusCode((int)HttpStatusCode.InternalServerError));
            }
        }