private bool disposedValue = false; // To detect redundant calls /// <summary> /// /// </summary> /// <param name="disposing"></param> protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { } _categories = null; _create = null; _delete = null; _update = null; disposedValue = true; } }
/// <summary> /// /// </summary> /// <param name="categoryName"></param> /// <returns></returns> public int Create(string categoryName = null) { try { if (_create == null) { var req = new CreateCategoryReq() { header = Client.RequestHeader }; if (!string.IsNullOrWhiteSpace(categoryName)) { req.categoryName = categoryName; } _create = _client.API.CreateCategory(req); } if (_create.errorCode == (int)errorCode.No_error) { return(_create.categoryId); } throw new FlexMailException(_create.errorMessage, _create.errorCode); } catch (Exception ex) { //telemetry.TrackException(ex, new Dictionary<string, string> { { "Flexmail", "Category.Create" } }); if (ex is FlexMailException) { throw (ex); } } finally { _create = null; } return(-1); }