internal static MvcHtmlString CollectionTableInternal(this HtmlHelper html, IEnumerable collection, IActionFacade action = null) { var nakedObject = html.Facade().GetObject(collection); Func <IAssociationFacade, bool> filterFunc; Func <IAssociationFacade, int> orderFunc; bool withTitle; if (action == null || action.ReturnType.IsVoid) { // todo investigate other ways to do this action = nakedObject.MementoAction; } CommonHtmlHelper.GetTableColumnInfo(action, out filterFunc, out orderFunc, out withTitle); return(html.GetStandaloneCollection(nakedObject, filterFunc, orderFunc, withTitle)); }
internal static MvcHtmlString CollectionTableInternal(this HtmlHelper html, IEnumerable collection, IActionSpec action = null) { INakedObject nakedObject = html.Framework().GetNakedObject(collection); Func <IAssociationSpec, bool> filterFunc; Func <IAssociationSpec, int> orderFunc; bool withTitle; if (action == null || action.ReturnSpec.IsVoid) { var memento = nakedObject.Oid as CollectionMemento; if (memento != null) { action = memento.Action; } } CommonHtmlHelper.GetTableColumnInfo(action, out filterFunc, out orderFunc, out withTitle); return(html.GetStandaloneCollection(nakedObject, filterFunc, orderFunc, withTitle)); }