Exemple #1
0
        public async Task <ActionResult <List <ClientOrderServiceResponseModel> > > GetClientOrders(int clientId)
        {
            base.DataLogger.LogInformation("Get Client Orders", clientId);


            try
            {
                var applicationClientOrders = await _clientOrder.GetClientOrders(clientId);

                if (applicationClientOrders == null)
                {
                    return(NotFound());
                }

                var responseClientOrders = _mapper.Map <List <ClientOrderServiceResponseModel> >(applicationClientOrders);


                return(Ok(responseClientOrders));
            }
            catch (Exception ex)
            {
                base.DataLogger.LogError(ex);
                return(BadRequest(base.GetResponseObject(Constants.ERROR_RESPONSE, Constants.ERROR_RESPONSE)));
            }
        }
        public async Task <ActionResult <IEnumerable <OrderMvcResponseListModel> > > Index()
        {
            var orders = await _clientOrder.GetClientOrders(1009);

            return(View(_mapper.Map <List <OrderMvcResponseListModel> >(orders)));
        }