private GridDefinition GetGridModel() { return(new GridDefinition { ModuleGuid = Module.ModuleGuid, SettingsModuleGuid = Module.PermanentGuid, RecordType = typeof(BrowseItem), AjaxUrl = GetActionUrl(nameof(RolesBrowse_GridData)), DirectDataAsync = async(int skip, int take, List <DataProviderSortInfo> sort, List <DataProviderFilterInfo> filters) => { using (RoleDefinitionDataProvider dataProvider = new RoleDefinitionDataProvider()) { DataProviderGetRecords <RoleDefinition> browseItems = await dataProvider.GetItemsAsync(skip, take, sort, filters); return new DataSourceResult { Data = (from s in browseItems.Data select new BrowseItem(Module, s)).ToList <object>(), Total = browseItems.Total }; } }, }); }