Hello guys, tell me how to convert the method to asynchronous?

[HttpGet] public IActionResult Index() { IEnumerable<CustomerViewModel> customers = _customerRepository.GetAllCustomers().Select(s => new CustomerViewModel { CustomerId = s.CustomerId, Name = s.Name, Adress = s.Adress }); return View("Index", customers); } 

Something like this should be

 public async Task<IActionResult> Index() 

But where is await? Do I go right?))

  • apparently GetAllCustomers () should be executed asynchronously, and then IEnumerable <customersViewModel> customers = await _customerRepository.GetAllCustomers () ... - haswell

0