Exemplo n.º 1
0
        public async Task <IActionResult> GetCustomerAsync(int id)
        {
            var result = await CustomersProvider.GetCustomerAsync(id);

            if (result.IsSuccess)
            {
                return(Ok(result.Customer));
            }
            return(NotFound(result.ErrorMessage));
        }
        public async Task <IActionResult> GetCustomerAsync(int id)
        {
            var result = await customersProvider.GetCustomerAsync(id);

            if (!result.IsSuccess)
            {
                return(NotFound($"Customer {id} not found."));
            }
            return(Ok(result.Customer));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> GetCustomerAsync(int id)
        {
            var(isSuccess, customer, _) = await _customersProvider.GetCustomerAsync(id);

            if (isSuccess)
            {
                return(Ok(customer));
            }
            return(NotFound());
        }
        public async Task <IActionResult> GetCustomerAsync(int id)
        {
            var result = await customersProvider.GetCustomerAsync(id).ConfigureAwait(false);

            if (result.IsSuccess)
            {
                return(Ok(result.Customer));
            }
            return(NotFound());
        }
        public async Task <IActionResult> GetProductAsync(int id)
        {
            var result = await _customersProvider.GetCustomerAsync(id);

            if (result.IsSuccess)
            {
                return(Ok(result.customer));
            }

            return(NotFound());
        }
        public async Task <IActionResult> GetCustomer(int id)
        {
            var result = await customersProvider.GetCustomerAsync(id);

            if (result.isSuccess == true)
            {
                return(Ok(result.Customer));
            }
            else
            {
                return(NotFound());
            }
        }