Store a Date field into an object

Gamedonia lets you work with the Date type directly. The first thing you will probably want to do is to store a Date field inside a Gameodnia object. Imagine you have a game log where you want to store the score of a player at a level and the Date when this score was obtained. Let's see how to do this:

Dictionary<string,object> record = new Dictionary<string,object>();  

record["level"] = 9;

DateTime d = DateTime.Now;  
record["the_date"] = d;

GamedoniaData.Create("records_colelction", record, delegate (bool cr_success, IDictionary data){  

    if (cr_success) {

        Debug.Log ("entity created");

    } else {

        Debug.Log("create failed");
    }
});

When this is done, you will see an object at the records_collection with a field of type Date called my_date and the value of the date at the moment of the creation of the object. You can check that at the Object Browser in the Gamedonia Dashboard.