Ejemplo n.º 1
0
        public async Task <IActionResult> Get(long?customerID, string email)
        {
            if (customerID != null)
            {
                InquiryView result = await _service.GetByCustomerID((long)customerID);

                if (result != null)
                {
                    return(Ok(result));
                }

                return(NotFound());
            }

            if (!String.IsNullOrEmpty(email))
            {
                InquiryView result = await _service.GetByEmail(email);

                if (result != null)
                {
                    return(Ok(result));
                }

                return(NotFound());
            }

            return(BadRequest("No inquiry criteria"));
        }