tl24 / jsonexserializer

Automatically exported from code.google.com/p/jsonexserializer
1 stars 1 forks source link

Allow custom handling of property in json that doesn't exist in object #43

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Given the following Json:

{
   ID: 1,
   OldProp: "value"
}

and the following class:
public class Foo {
   public int ID { get; set; }
   public string NewProp { get; set; }
}

Give the user a way of handling the fact that "OldProp" does not exist on 
the object.  The default will be to throw an exception.  The user can 
register a custom delegate to handle missing properties.  Typical actions 
could be to ignore the missing property or assign it to a different 
property in the case of a rename refactoring.

Original issue reported on code.google.com by elliott....@gmail.com on 3 Jul 2009 at 12:47

GoogleCodeExporter commented 9 years ago
Issue 54 addresses the problem somewhat, but it only allows you to ignore the 
property 
at the moment.

Original comment by elliott....@gmail.com on 16 Apr 2010 at 2:49