An attempt to remove ServiceStack dependency, update .NET version to 4.5 and make this cross-platform
Please see @jtourkos's and my work here: https://github.com/theofanis/MailChimp.NET
This is a late night's work, no more than a couple of hours in total. Our main purpose was to overcome ServiceStack dependency for one of our internal projects, but made a few more changes to fulfill requirements others may find useful and start building from there in order to make this compatible with their projects. Please see some notes below as well:
- Created a PCL
MailChimp.Portabletargeting mobile platforms, .net 4.5 and the new ASP.NET 5.0 (.NET Core) and copy-pasted all existing class files fromMailChimpproject - Didn't rename namespaces in existing classes as to not break code referencing this
- Removed Servicestack dependency
Json.NETnow handles de/serializationHttpClientnow makes REST API calls (not using await, blocking with.Resultas to not change the Interfaces at all, although that is not hard at all if one wants to make this 100% async)
- Changed
ListInfo.DateLastCampaigntoDateTime?to overcome null value deserialization - Created a JsonConverter to use on properties that are objects in JSON responses but appear as empty arrays when their value should be null. For example,
Campaign.SegmentOptswhich is of typeCampaignSegmentOptionsbut may appear as an empty array in the JSON response when fetching campaigns - Replaced
DataMemberattributes withJsonProperty
Disclaimer: The portable project is not unit tested at all and may not work corrrectly for all calls
@theofanis This is a great effort! I think we should bump the major version information in the build, and you should make an official pull request. Many folks have expressed a desire to see these changes. Also: I think we should expose the async/await methods as the first-class API signatures.
Thoughts?
Sorry for the delay man. Feel free to act on the pr. My contribution will probably be limited from now on because of time restrictions, but I will definitely keep my eye on this.
Btw, you can probably change the interfaces to make them fully async in the Portable project, since that's a new one and keep the old one for legacy compatibility.
Cheers!