public async Task <PartialViewResult> OnGetViewAllPartial() { Customers = await _customer.GetAllAsync(); return(new PartialViewResult { ViewName = "_ViewAll", ViewData = new ViewDataDictionary <IEnumerable <Customer> >(ViewData, Customers) }); }
public async Task <IActionResult> GetAll() { try { var customers = await _customerRepository.GetAllAsync(); return(Ok(customers)); } catch (Exception ex) { _logger.LogError(ex.Message); return(BadRequest()); } }