Esempio n. 1
0
        public UnsubscribedUser SaveUnsubscribedUser(UnsubscribedUser unsubscribedUser)
        {
            unsubscribedUser.EmailId = unsubscribedUser.EmailId.ToLower();
            var exUnsubscribedUser = GetUnsubscribedUser(unsubscribedUser.EmailId);

            if (exUnsubscribedUser != null)
            {
                unsubscribedUser.Id = exUnsubscribedUser.Id;
            }
            unsubscribedUser.LastUpdated = DateTime.UtcNow;
            var result = _client.Index(unsubscribedUser);
            IsServerError(result);
            unsubscribedUser.Id = result.Id;
            _client.Refresh();
            return unsubscribedUser;
        }
Esempio n. 2
0
 public bool DeleteUnsubscribedUser(UnsubscribedUser unsubscribedUser)
 {
     var result = _client.Delete(unsubscribedUser);
     return IsServerError(result);
 }