public virtual void WriteSalesforceData(ISalesforceContact contact)
        {
            var personal = this.Personal;

              personal.FirstName = contact.GetProperty<string>("FirstName");
              personal.Surname = contact.GetProperty<string>("LastName");
              personal.JobTitle = contact.GetProperty<string>("JobTitle");
              personal.BirthDate = contact.GetProperty<DateTime?>("Birthdate");

              this.Email.SmtpAddress = contact.Email;

              this.Phone.Number = contact.GetProperty<string>("Phone");
        }
 public SalesforceMembershipUser(string providerName, ISalesforceContact salesforceContact)
     : base(providerName,
   salesforceContact.Login,
   salesforceContact.Id,
   salesforceContact.Email,
   salesforceContact.PasswordQuestion,
   salesforceContact.Description,
   salesforceContact.IsApproved,
   false,
   creationDate: salesforceContact.CreatedDate.ToLocalTime(),
   lastLoginDate: salesforceContact.LastLoginDate.ToLocalTime(),
   lastActivityDate: salesforceContact.LastActivityDate.ToLocalTime(),
   lastPasswordChangedDate: salesforceContact.LastPasswordChangedDate.ToLocalTime(),
   lastLockoutDate: salesforceContact.LastLockoutDate)
 {
     this.SalesforceContact = salesforceContact;
 }
 public void Add(ISalesforceContact salesforceUser)
 {
     base.InnerCache.Add(salesforceUser.Login, salesforceUser.Id, TypeUtil.SizeOfString(salesforceUser.Id), this.SlidingExpiration);
       base.InnerCache.Add(salesforceUser.Id, salesforceUser, salesforceUser.GetDataLength(), this.SlidingExpiration);
 }
        public virtual bool Update(ISalesforceContact contact)
        {
            var properties = new Dictionary<string, object>(contact.Properties.Count);

              foreach (var pair in contact.Properties)
              {
            properties[pair.Key] = pair.Value;
              }

              properties.Remove("Id");
              properties.Remove("Name");
              properties.Remove("CreatedDate");

              var result = this.Client.HttpPatch(string.Format("sobjects/{0}/{1}", this.ContactObjectName, contact.Id), properties);
              return result;
        }
        protected virtual Dictionary<string, object> GetProperties(ISalesforceContact contact, string[] propertyNames)
        {
            if (contact == null)
              {
            return new Dictionary<string, object>(0);
              }

              var dictionary = new Dictionary<string, object>(propertyNames.Length);

              foreach (var propertyName in propertyNames)
              {
            object value = contact.GetProperty<object>(propertyName);

            if (value != null)
            {
              dictionary[propertyName] = value;
            }
              }

              return dictionary;
        }