Example #1
0
        /// <summary>
        /// Add paratner userId and if it already exist then updates it
        /// </summary>
        /// <param name="partner">the partner for filtering</param>
        /// <param name="partnerUserId">Partner user Id</param>
        /// <param name="assignedByPartner">Value that indicates whether the partner user ID was assigned by the partner.</param>
        public void AddOrUpdatePartnerUserId(Partner partner, string partnerUserId, bool assignedByPartner)
        {
            PartnerUserInfo info = PartnerUserInfoList.FirstOrDefault(_ => _.PartnerId == partner);

            if (info == null)
            {
                info = new PartnerUserInfo
                {
                    PartnerUserId     = partnerUserId,
                    PartnerId         = partner,
                    AssignedByPartner = assignedByPartner
                };

                PartnerUserInfoList.Add(info);
            }
            else
            {
                info.PartnerUserId     = partnerUserId;
                info.AssignedByPartner = assignedByPartner;
            }
        }
Example #2
0
        /// <summary>
        /// Gets partner user info list. Appends explicitly stored with derived values
        /// </summary>
        /// <param name="partner">
        /// the partner for filtering
        /// </param>
        /// <returns>
        /// partner user id
        /// </returns>
        public string GetPartnerUserId(Partner partner)
        {
            PartnerUserInfo info = PartnerUserInfoList.FirstOrDefault(_ => _.PartnerId == partner);

            return(info == null ? UserIdHexFormat : info.PartnerUserId);
        }