Esempio n. 1
0
 IEnumerable<BehaviorChain> FindChainsWithoutViews(BehaviorGraph graph, ViewBag bag)
 {
     return from b in graph.Behaviors
            where b.ActionOutputType() != null
                 && b.ActionOutputType().Closes(typeof(AwesomeCreateModel<>))
            let output = b.ActionOutputType()
            where !bag.ViewsFor(output).Any()
            select b;
 }
Esempio n. 2
0
        public void Configure(ViewBag bag, BehaviorGraph graph)
        {
            FindChainsWithoutViews(graph, bag).Each(b =>
            {
                var output = b.ActionOutputType();
                var entityType = output.GetGenericArguments()[0];
                var handlerType = typeof (AwesomeCreateHandler<>).MakeGenericType(entityType);
                var method = handlerType.GetMethod("DaisyChain");
                b.AddToEnd(new ActionCall(handlerType,method));

                var token = bag.ViewsFor(typeof (AwesomeEditModel)).First();
                b.AddToEnd(token.ToBehavioralNode());
            });
        }
 public IEnumerable<IViewToken> Apply(ActionCall call, ViewBag views)
 {
     return views.ViewsFor(call.OutputType()).Where(view => view.Name == call.Method.Name && view.Folder == call.HandlerType.Namespace);
 }
Esempio n. 4
0
 public IEnumerable <IViewToken> Apply(ActionCall call, ViewBag views)
 {
     return(views.ViewsFor(call.OutputType()));
 }
 public IEnumerable<IViewToken> Apply(ActionCall call, ViewBag views)
 {
     return views.ViewsFor(call.OutputType());
 }
Esempio n. 6
0
 public IEnumerable <IViewToken> Apply(ActionCall call, ViewBag views)
 {
     return(views.ViewsFor(call.OutputType()).Where(view => view.Name == call.Method.Name && view.Folder == call.HandlerType.Namespace));
 }