Ejemplo n.º 1
0
        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());
        }
Ejemplo n.º 3
0
        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));
            }
        }
Ejemplo n.º 4
0
 public async Task OnGetAsync()
 {
     Customer = await _customersService.GetAllCustomers();
 }
Ejemplo n.º 5
0
        public async Task <IActionResult> GetCustomers()
        {
            var customerList = await _customersService.GetAllCustomers();

            return(Json(customerList));
        }
Ejemplo n.º 6
0
        public async Task <ActionResult> GetAlls()
        {
            var customers = await _customerService.GetAllCustomers();

            return(Ok(customers));
        }