Example #1
0
        public async Task <IActionResult> Get(Guid customerId)
        {
            if (customerId == Guid.Empty)
            {
                return(BadRequest("User input not valid"));
            }

            var result = await _customerQueryService.Get(customerId);

            if (result.StatusCode == ECommerce.Shared.StatusCode.NotFound)
            {
                return(NotFound("Customer reference not found"));
            }

            return(Ok(new CustomerDto
            {
                Lastname = result.Data.Lastname,
                Firstname = result.Data.Firstname,
                Email = result.Data.Email,
                AccountId = result.Data.AccountId,
                Id = result.Data.Id
            }));
        }
Example #2
0
 public IHttpActionResult Get(Guid id)
 {
     return(Ok(_customerQueryService.Get(id)));
 }