Closed ibuildit closed 8 years ago
Adding a note here that RetrieveNode() uses XmlRpcStruct and RetrieveUseR() uses DrupalUser, which hooks into a lot of other stuff related to the login.
I can't work out how to create a ToBaseTerm method in the ExtensionMethods class.
I tried the following:
public static BaseTaxonomyTerm ToBaseTerm(this IDictionary value)
{
return ConvertToType<BaseTaxonomyTerm>(value);
}
For now, it's possible to deserialise Taxonomy Terms this way though:
var ser = new System.Web.Script.Serialization.JavaScriptSerializer();
WriteLine("Markets: " + ser.Deserialize<BaseTaxonomyTerm>(ser.Serialize(marketTerm)).name);
To be continued..
Hi @ibuildit I have sketched a new project: Drupal7.ServiceModel
It contains a few classes that can be used with XML-RPC:
using Drupal7.ServiceModel.ContentTypes;
using Drupal7.Services;
var d7 = new DrupalServices ("http://www.example.net/services/xmlrpc");
var article = d7.NodeRetrieve (1).ConvertToType<DrupalArticle>();
As well as with REST/JSON:
using RestSharp;
var client = new RestClient("http://www.example.net/services/rest");
var request = new RestRequest("node/1.json");
var response = client.Execute<DrupalArticle>(request);
The fields have been modelled as dictionaries to support entity translation.
I really like the ExtensionMethods, but they don't work with Users. I have created a BaseUser.cs file as a starting point.
}