/// <summary> /// /// </summary> /// <param name="emailAddressType"></param> /// <param name="mailingListId"></param> /// <returns></returns> public int Update(EmailAddressType emailAddressType = null, string mailingListId = null) { try { if (_update == null) { var req = new UpdateEmailAddressReq() { header = Client.RequestHeader }; if (emailAddressType != null) { req.emailAddressType = emailAddressType; } if (!string.IsNullOrWhiteSpace(mailingListId)) { req.mailingListId = int.Parse(mailingListId); } _update = _client.API.UpdateEmailAddress(req); } if (_update.errorCode == (int)errorCode.No_error) { return(_update.emailAddressId); } throw new FlexMailException(_update.errorMessage, _update.errorCode); } catch (Exception ex) { //telemetry.TrackException(ex, new Dictionary<string, string> { { "Flexmail", "EmailAddress.Update" } }); if (ex is FlexMailException) { throw (ex); } } finally { _update = null; } return(-1); }
private bool disposedValue = false; // To detect redundant calls /// <summary> /// /// </summary> /// <param name="disposing"></param> protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { } _create = null; _delete = null; _emailaddresses = null; _update = null; _history = null; _import = null; disposedValue = true; } }