public static IViewToken ViewFor(this IOutputNode node, IConditional conditional) { var media = node.Media().Where(x => x.Writer is IViewWriter && x.Condition == conditional).FirstOrDefault(); return(media == null ? null : media.Writer.As <IViewWriter>().View); }
public static IViewToken ViewFor(this IOutputNode node) { var media = node.Media().OfType <IViewWriter>().FirstOrDefault(); return(media == null ? null : media.View); }
public MediaCollection(IOutputNode node) { _media = new Lazy <IEnumerable <IMedia <T> > >(() => node.Media <T>().ToArray()); }