Esempio n. 1
0
        public Response <CustomerDTO> Get(string customerId)
        {
            var response = new Response <CustomerDTO>();

            try
            {
                var customer = customerDomain.Get(customerId);
                response.Data = mapper.Map <CustomerDTO>(customer);
                if (response.Data != null)
                {
                    response.IsSuccess = true;
                    response.Message   = "Registro exitoso";
                }
            }
            catch (Exception e)
            {
                response.Message = e.Message;
            }
            return(response);
        }
        public Response <CustomersDTO> Get(string customerId)
        {
            var response = new Response <CustomersDTO>();

            try
            {
                var customer = _customerDomain.Get(customerId);
                response.Data = _mapper.Map <CustomersDTO>(customer);
                if (response.Data != null)
                {
                    response.IsSuccess = true;
                    response.Message   = "Consulta exitosa";
                }
            }
            catch (Exception ex)
            {
                response.Message = ex.Message;
            }

            return(response);
        }