async Task <IEnumerable <ContentBlock> > GetSource(vm.ContentBlocksList info) { var query = Database.Of <ContentBlock>(); var result = await query.GetList(); if (info.Sort.Expression == "Content") { result = info.Sort.Apply(result, item => item.Content); } else { result = info.Sort.Apply(result); } return(result); }
public async Task OnBound(vm.ContentBlocksList info) { info.Items = await GetSource(info) .Select(item => new vm.ContentBlocksList.ListItem(item)).ToList(); }
public async Task <ActionResult> Index(vm.ContentBlocksList info) { return(View(info)); }