public async Task <ActionResult <IEnumerable <SearchResult> > > Index() { try { return(Ok(await Dataloader.GetListAsync(Type))); } catch (Exception) { return(NotFound()); } }
public async Task <ActionResult <IEnumerable <SearchResult> > > SearchCode(string value) { try { var list = await Dataloader.GetListAsync(Type); var res = list.Where(r => !string.IsNullOrEmpty(r.Key) && r.Key.StartsWith(value, true, null)); return(Ok(res)); } catch (Exception) { return(null); } }