public dynamic GetResults(LibrarySettings.Application app, FormCollection form, AuthPrincipal user, int page = 0, string sort = "") { if (page == 0) { return(new { recordsTotal = 0, recordsFiltered = 0, data = new List <List <string> >() }); } IDictionary <string, object> searchParameters = BuildSearchParameters(app.Fields, form); var sortings = BuildSorting(sort, app.Fields); var searchOptions = new SearchOptions { SearchParameters = searchParameters, Page = page, Sortings = sortings }; var searchResult = documentSearchEngine.Search(searchOptions); var dataTableResults = GetDataTableResults(searchResult.Records, app, form, user); return(new { recordsTotal = searchResult.TotalCount, recordsFiltered = searchResult.FilteredCount, data = dataTableResults }); }
public dynamic GetResults(LibrarySettings.Application app, FormCollection form, AuthPrincipal user, int page = 0, string sort = "") { var adapter = GetAdapterForApplication(app.ID); var adapterType = adapter.GetType(); var getResultsMethod = adapterType.GetMethod("GetResults"); return(getResultsMethod.Invoke(adapter, new object[] { app, form, user, page, sort })); }