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; _mailingLists = null; _truncate = null; _update = null; disposedValue = true; } }
/// <summary> /// /// </summary> /// <param name="categoryId"></param> /// <returns></returns> public List <MailingListType> MailingLists(string categoryId = null) { try { if (_mailingLists == null) { var req = new GetMailingListsReq() { header = Client.RequestHeader }; if (!string.IsNullOrWhiteSpace(categoryId)) { req.categoryId = int.Parse(categoryId); } _mailingLists = _client.API.GetMailingLists(req); } if (_mailingLists.errorCode == (int)errorCode.No_error) { return(_mailingLists.mailingListTypeItems.ToList <MailingListType>()); } throw new FlexMailException(_mailingLists.errorMessage, _mailingLists.errorCode); } catch (Exception ex) { //telemetry.TrackException(ex, new Dictionary<string, string> { { "Flexmail", "MailingList.MailingLists" } }); if (ex is FlexMailException) { throw (ex); } } finally { _mailingLists = null; } return(new List <MailingListType>()); }