Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.

An attempt to remove ServiceStack dependency, update .NET version to 4.5 and make this cross-platform #176

Open
theofanis opened this issue Dec 22, 2015 · 2 comments

Comments

@theofanis
Copy link

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.Portable targeting mobile platforms, .net 4.5 and the new ASP.NET 5.0 (.NET Core) and copy-pasted all existing class files from MailChimp project
  • Didn't rename namespaces in existing classes as to not break code referencing this
  • Removed Servicestack dependency
    • Json.NET now handles de/serialization
    • HttpClient now makes REST API calls (not using await, blocking with .Result as to not change the Interfaces at all, although that is not hard at all if one wants to make this 100% async)
  • Changed ListInfo.DateLastCampaign to DateTime? 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.SegmentOpts which is of type CampaignSegmentOptions but may appear as an empty array in the JSON response when fetching campaigns
  • ReplacedDataMember attributes with JsonProperty

Disclaimer: The portable project is not unit tested at all and may not work corrrectly for all calls

@danesparza
Copy link
Owner

@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?

@theofanis
Copy link
Author

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!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants