public async Task <ActionResult <IEnumerable <CustomerAPIModel> > > GetAllCustomers() { var customers = await _customersService.GetAllCustomers(); var customersAPIModel = _mapper.Map <IEnumerable <Customers>, IEnumerable <CustomerAPIModel> >(customers); return(Ok(customersAPIModel)); }
public ActionResult Get() { var serviceResult = _service.GetAllCustomers(); if (serviceResult.Status == eOperationStatus.Success) { return(Ok(serviceResult)); } return(NotFound()); }
public async Task <IActionResult> GetAllCustomers() { try { var customers = await _customersService.GetAllCustomers(); var _customers = customers.ToArray(); if (_customers.Length == 0) { return(BadRequest("No customers found!")); } return(Ok(customers)); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public async Task OnGetAsync() { Customer = await _customersService.GetAllCustomers(); }
public async Task <IActionResult> GetCustomers() { var customerList = await _customersService.GetAllCustomers(); return(Json(customerList)); }
public async Task <ActionResult> GetAlls() { var customers = await _customerService.GetAllCustomers(); return(Ok(customers)); }