public async Task <ReferralResultResponse> GetAsync(string customerId) { try { if (!TryParseGuid(customerId, nameof(GetAsync), out var customerIdGuid)) { return(new ReferralResultResponse { ErrorCode = ReferralErrorCodes.GuidCanNotBeParsed, ErrorMessage = InvalidIdentifierMessage }); } var referral = await _referralService.GetReferralByCustomerIdAsync(customerIdGuid); return(_mapper.Map <ReferralResultResponse>(referral)); } catch (CustomerNotFoundException e) { Log.Info(e.Message, customerId); return(new ReferralResultResponse() { ErrorCode = ReferralErrorCodes.ReferralNotFound, ErrorMessage = e.Message }); } }