public IList <TelephoneNote> GetAll() { List <TelephoneNote> result = null; try { result = telephoneRepository.GetTelephoneNotes().GetAwaiter().GetResult(); } catch (Exception ex) { Console.WriteLine(ex); } return(result); }
public async Task <ActionResult> Index() { if (telephoneRepository is TelephoneMSSqlRepository) { ViewBag.CurrentSource = "MS SQL Server"; } else { ViewBag.CurrentSource = "JSON FILE"; } List <TelephoneNote> result = null; try { result = await telephoneRepository.GetTelephoneNotes(); } catch (Exception ex) { Console.WriteLine(ex); } return(View(result)); }
public List <TelephoneNote> GetAll() { return(telephoneRepository.GetTelephoneNotes().GetAwaiter().GetResult()); }