示例#1
0
 public async Task <ActionResult <IEnumerable <SearchResult> > > Index()
 {
     try
     {
         return(Ok(await Dataloader.GetListAsync(Type)));
     }
     catch (Exception)
     {
         return(NotFound());
     }
 }
示例#2
0
        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);
            }
        }