public async Task <IMessage[]> Execute()
            {
                var  splitByType        = IncTypes.Split(UrlDispatcher.separatorByType.ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
                bool isCompositeAsArray = splitByType.Count() == 1 && IsComposite.GetValueOrDefault();

                if (isCompositeAsArray)
                {
                    return(((IEnumerable <IMessage>)await new CreateMessageByType2()
                    {
                        Type = splitByType[0],
                        Controller = this.Controller,
                        IsGroup = true
                    }.Execute()).ToArray());
                }

                List <IMessage> cbs = new List <IMessage>();

                foreach (var r in splitByType)
                {
                    IMessage cb = (IMessage)await new CreateMessageByType2()
                    {
                        Type = r, Controller = this.Controller
                    }.Execute();
                    cbs.Add(cb);
                }
                return(cbs.ToArray());
            }
Exemple #2
0
            protected override CommandBase[] ExecuteResult()
            {
                var  splitByType        = IncTypes.Split(UrlDispatcher.separatorByType.ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
                bool isCompositeAsArray = splitByType.Count() == 1 && IsComposite.GetValueOrDefault();

                return(isCompositeAsArray
                               ? ((IEnumerable <CommandBase>)Dispatcher.Query(new CreateByTypeQuery()
                {
                    Type = splitByType[0],
                    ControllerContext = ControllerContext,
                    ModelState = ModelState,
                    IsGroup = true
                })).ToArray()
                               : splitByType.Select(r => (CommandBase)Dispatcher.Query(new CreateByTypeQuery()
                {
                    Type = r, ControllerContext = this.ControllerContext, ModelState = ModelState
                })).ToArray());
            }