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; }
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); }
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()); }
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)); }