android - Better Approach to Parse a common Json and insert it into DB -


I have two web servers returning the same type of data:

Data1:

"ModelCode": 23, "module id": 37, "name", "message", "message", "blank", "message" ":" availability index "," pentamule idid ": empty," sequence "," UserID ": 0," UserRollID ": 0}]}

Data 2:

What I have done, I have created a single DTO class to parse them both data using the GSON library such as:

  Private intUderID; Private boolean ismatry; Private Ind index; Private india module id; Private Ind ModuleCode; Private string module Icon; Private boolean is Questian type; The private boolean is the storage device; Private string parentmoded; Private string UserRoleID; The name of the private string; Private Aralist & lt; Question & gt; questions;  

And insert darse data into the data in DB and data table 2.

The above approach works fine but I just want to know:

1.Is this the best way to parse two similar (approximate) json

2. Or if I make two DTOs for each JSN data, then the best way.

Which is the best way to top two and why ?? Or there is no other way to do this (except for manual parsing).


Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -