/// <summary> /// Utility method to fetch an Arena newsletter which corresponds to the given MailChimp List. /// </summary> /// <param name="listID">List ID of a MailChimp list</param> /// <returns>newsletterID of a corresponding Arena newsletter; otherwise returns -1.</returns> private int GetNewsletterIDFromMailChimpListID(string listID) { int newsletterID = -1; LookupCollection mailChimpLists = new LookupCollection(new Guid(MailChimpLookupGUIDSetting)); var query = (from lookup in mailChimpLists.OfType <Lookup>() where lookup.Qualifier == listID select lookup).FirstOrDefault(); if (query != null) { newsletterID = int.Parse(query.Qualifier2); } return(newsletterID); }
/// <summary> /// Utility method to fetch an Arena newsletter which corresponds to the given MailChimp List. /// </summary> /// <param name="listID">List ID of a MailChimp list</param> /// <returns>newsletterID of a corresponding Arena newsletter; otherwise returns -1.</returns> private int GetNewsletterIDFromMailChimpListID( string listID ) { int newsletterID = -1; LookupCollection mailChimpLists = new LookupCollection( new Guid( MailChimpLookupGUIDSetting ) ); var query = ( from lookup in mailChimpLists.OfType<Lookup>() where lookup.Qualifier == listID select lookup ).FirstOrDefault(); if ( query != null ) { newsletterID = int.Parse( query.Qualifier2 ); } return newsletterID; }