예제 #1
0
        /// <summary>
        /// Determines whether the specified object has equal values to this object in all fields.
        /// </summary>
        /// <param name="obj">
        /// The object whose values to compare.
        /// </param>
        /// <returns>
        /// True if the two objects have the same values.
        /// </returns>
        public override bool Equals(object obj)
        {
            PartnerUserInfo partnerUserInfo = (PartnerUserInfo)obj;

            return(PartnerId == partnerUserInfo.PartnerId &&
                   PartnerUserId == partnerUserInfo.PartnerUserId);
        }
예제 #2
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;
            }
        }
예제 #3
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);
        }
예제 #4
0
 /// <summary>
 /// Initializes a new instance of the class derived from PartnerUserInfo class, using the fields from the specified other
 /// PartnerUserInfo.
 /// </summary>
 /// <param name="partnerUserInfo">
 /// The other PartnerUserInfo whose fields to copy.
 /// </param>
 internal PartnerUserInfo(PartnerUserInfo partnerUserInfo)
 {
     PartnerId     = partnerUserInfo.PartnerId;
     PartnerUserId = partnerUserInfo.PartnerUserId;
 }