cdanielm58 / google-api-dotnet-client

Automatically exported from code.google.com/p/google-api-dotnet-client
Apache License 2.0
0 stars 0 forks source link

Support "dynamic" models #379

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The .NET library should support something like GenericJson for our models.
Currently if we want to add a dynamic field to a model, we can't to that. The 
Java implementation allows the user to set a "dynamic" property, e.g.:

SomeModel model = new SomeModel();
model.put("prop1", "1111111");
model.put("prop2", 2);

which will be translated into:

{
  "prop1": "111111",
  "prop2": 2
}

So our model should implement something like a map to set properties.
notice that if you set a property that already exist in the class declaration 
you should call the regular set, so object like:

class Model1 
{
  int prop { get; set;}
}

var m = new Model1();
m.prop = 2;
m.put("prop", 4)

will be represented as:
{
  "prop": 4
}

Original issue reported on code.google.com by pele...@google.com on 20 Aug 2013 at 7:48

GoogleCodeExporter commented 9 years ago

Original comment by pele...@google.com on 27 Sep 2013 at 6:50

GoogleCodeExporter commented 9 years ago

Original comment by pele...@google.com on 1 Oct 2013 at 5:32