public CompanyInfoResponse ToCompanyInfoResponse() { var hierarchyAddress = GetHierarchyAddress(); var ERPHierarchyName = ADDRESS_OUT.SingleOrDefault(i => i.ADDRNUMBER == hierarchyAddress).NAME1; var ERPHierarchyNumber = PARTNERS_OUT.Where(i => i.PARTN_ROLE == SAP_HIERARCHY_NUMBER).First()?.CUSTOMER; return(new CompanyInfoResponse { ERPHierarchy = new ERPHierarchy(ERPHierarchyNumber, ERPHierarchyName) }); }
public PartnerResponse ToPartnerResponse() { var hierarchyAddress = GetHierarchyAddress(); var partners = PARTNERS_OUT.Where(RemoveContactsAndDuplicateBillTos).Select(GetPartnerDetails).ToList(); var result = new PartnerResponse { ERPHierarchyName = ADDRESS_OUT.SingleOrDefault(i => i.ADDRNUMBER == hierarchyAddress).NAME1, ERPHierarchyNumber = PARTNERS_OUT.Where(i => i.PARTN_ROLE == SAP_HIERARCHY_NUMBER).First()?.CUSTOMER, Partners = partners }; return(result); }