public async Task <IEnumerable <Portal> > GetAllPortalRecords() { try { IAsyncRepository <Portal> portalRepo = new PortalsAsyncRepository(_db); return(await portalRepo.GetAllAsync()); } catch (SqlException ex) { throw ex; } }
private async Task <IEnumerable <Portal> > GetPortalRecords(IDbConnection db) { IEnumerable <Portal> portals = new List <Portal>(); try { IAsyncRepository <Portal> portalRepo = new PortalsAsyncRepository(db); return(await portalRepo.GetAllAsync()); } catch (Exception) { lblStatus.Text = "Error getting Portals"; } var portal = new Portal() { Description = "NOT FOUND" }; portals.ToList().Add(portal); return(portals); }