Hi all!
Here are all the proxy classes for the current data sets.
(The links to the C# proxy classes have been relocated to the individual content providers’ page. You can access the pages via here.)
—
Exploring CS file contents:
I would advise everyone to peek into the CS file to see what it has. There are 2 main things to take note before using the class file namely the ‘Namespace’, ‘Entity Name’ and ‘Data Service URI’.
The ’Data Service URI’ is self explanatory. Taking Hungry Go Where as example, the value will be:
https://api.projectnimbus.org/hgwodataservice.svc/
Lets take Hungry-Go-Where’s CS File for example. At the very top of the file after the namespace, you will see this:
partial class HGWEntities : global::System.Data.Services.Client.DataServiceContext
In this case, our ‘Entity Name’ is “HGWEntities”
In our next phase, we would be using ‘Namespace’, ‘Entity Name’ and ‘Data Service URI’ as reference to these mentioned in the current phase.
—
Usage:
- Include the cs file in your project.
- Create a new instance of the Entity.
e.g; Namespace.EntityName newInstance = new Namespace.EntityName(new Uri(“Data Service URI”)); - Add a static void method to modify request headers,
e.g; private static void ModifyRequest(object sender, SendingRequestEventArgs e)
{
e.Request.Headers.Add(“AccountKey”, “AccountKeyHere“);
e.Request.Headers.Add(“UniqueUserID”, Guid.NewGuid().ToString());
}
Note: You must change the AccountKey with your own Account Key value and you may choose to change the UniqueUserID to any GUID. - Add an event handler to intercept the request before sending the request to the data service.
e.g; newInstance.SendingRequest += ModifyRequest;
You all all ready to go by now.
Next is using the methods inside the newInstance which you have instantiated.
For Hungry Go Where, there is a collection named RestaurantSet (refer to data service uri: https://api.projectnimbus.org/hgwodataservice.svc/ ) so you can use it by simply calling ‘newInstance.RestaurantSet’ .
Have fun playing with the data service

Pingback: Consuming Data Service in VS2010 « Project Nimbus
Pingback: Datasets – Singapore Land Transport Authority (LTA) « Project Nimbus
Pingback: Datasets – Singapore National Environment Agency (NEA) « Project Nimbus
Pingback: Datasets – HungryGoWhere (HGW) « Project Nimbus
Pingback: Datasets – National Library Board (NLB) « Project Nimbus
Pingback: Datasets – Singapore Post (SP) « Project Nimbus
Pingback: Datasets – ShowNearBy (SNB) « Project Nimbus
Pingback: Datasets – Cinema Online (CO) « Project Nimbus
Pingback: Datasets – Singapore Tourism Board (STB) « Project Nimbus
Pingback: Datasets – Chlkboard (CHKB) | Project Nimbus
Pingback: Datasets – User Contributed Content (USR) | Project Nimbus
Pingback: Datasets – Chlkboard | Project Nimbus
Pingback: Datasets – Places.sg | Project Nimbus