public EmailCartReminderEmail(Profile profile, string profileLink)
 {
     ToAddress = profile.Email;
     TokenData = new
     {
         FullName = profile.FullName,
         ProfileLink = profileLink
     };
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ProfileInterest"/> class.
 /// </summary>
 /// <param name="profile">The profile.</param>
 /// <param name="interest">The interest.</param>
 /// <exception cref="System.ArgumentNullException">
 /// profile
 /// or
 /// interest
 /// </exception>
 public ProfileInterest(Profile profile, Interest interest)
 {
     if (profile == null)
         throw new ArgumentNullException("profile");
     if (interest == null)
         throw new ArgumentNullException("interest");
     Interest = interest;
     Profile = profile;
 }
        public ProfileProviderOrgUnit(Profile profile, ProviderOrgUnit providerOrgUnit)
        {
            if (profile == null)
            {
                throw new ArgumentNullException("profile");
            }
            if (providerOrgUnit == null)
            {
                throw new ArgumentNullException("providerOrgUnit");
            }

            Profile = profile;
            ProviderOrgUnit = providerOrgUnit;
        }
        private void FixupProfile(Profile previousValue)
        {
            if (previousValue != null && previousValue.ProfileProviderLocations.Contains(this))
            {
                previousValue.ProfileProviderLocations.Remove(this);
            }

            if (Profile != null)
            {
                if (!Profile.ProfileProviderLocations.Contains(this))
                {
                    Profile.ProfileProviderLocations.Add(this);
                }
                if (ProfileId != Profile.Id)
                {
                    ProfileId = Profile.Id;
                }
            }
        }