Skip to main content
deleted 1 characters in body
Source Link
Ankit
  • 153
  • 8

suggest architecturestructure for classes that maps to json with dynamic data without using dynamic or object reference

this is a kind of data i have to de-serialize

{
    "id": "M:11427",
    "title": "DAX30",
    "nextStartId": "S:727831",
    "sections": [
        {
            "type": "HIGHLIGHTS",
            "baseResults": [ values of type highlights ],
            "hasMore": true
        },
        {
            "type": "CHART",
            "hasMore": false,
            "chartTypes": [ string values ]
        },
        {
            "type": "TWEETS",
            "baseResults": [ values of type tweets ],
            "hasMore": true
        }]
}

I have to serialize & deserialize them all. I want to create something that can hold the values corresponding to baseResults.

there is a main class that represent the whole json

class Data 
{
...
ObservableCollection<Section> sections{get;set;}
...
}

then there is a class that represents the data in sections array of main json

class Section
{
string type{get;set;}// thisthi elements decides what kind of data would be in baseResults
dynamic baseResults{get;set;} //it should hold ObservableCollection of either Highlights or Tweets etc.
}

base class for type of data coming in baseResults array is an abstract class class CategoryData and its children are class Highlights & class Tweets

I am using dynamic since I can not assign an ObservableCollection<CategoryData> with ObservableCollection<Highlights>. But I don't want to use this dynamic or object type instead I want something relevant. please suggest me what could be a better approach for this problem.

suggest architecture for classes that maps to json with dynamic data without using dynamic or object reference

this is a kind of data i have to de-serialize

{
    "id": "M:11427",
    "title": "DAX30",
    "nextStartId": "S:727831",
    "sections": [
        {
            "type": "HIGHLIGHTS",
            "baseResults": [ values of type highlights ],
            "hasMore": true
        },
        {
            "type": "CHART",
            "hasMore": false,
            "chartTypes": [ string values ]
        },
        {
            "type": "TWEETS",
            "baseResults": [ values of type tweets ],
            "hasMore": true
        }]
}

I have to serialize & deserialize them all. I want to create something that can hold the values corresponding to baseResults.

there is a main class that represent the whole json

class Data 
{
...
ObservableCollection<Section> sections{get;set;}
...
}

then there is a class that represents the data in sections array of main json

class Section
{
string type{get;set;}// this elements decides what kind of data would be in baseResults
dynamic baseResults{get;set;} //it should hold ObservableCollection of either Highlights or Tweets etc.
}

base class for type of data coming in baseResults array is an abstract class class CategoryData and its children are class Highlights & class Tweets

I am using dynamic since I can not assign an ObservableCollection<CategoryData> with ObservableCollection<Highlights>. But I don't want to use this dynamic or object type instead I want something relevant. please suggest me what could be a better approach for this problem.

suggest structure for classes that maps to json with dynamic data without using dynamic or object reference

this is a kind of data i have to de-serialize

{
    "id": "M:11427",
    "title": "DAX30",
    "nextStartId": "S:727831",
    "sections": [
        {
            "type": "HIGHLIGHTS",
            "baseResults": [ values of type highlights ],
            "hasMore": true
        },
        {
            "type": "CHART",
            "hasMore": false,
            "chartTypes": [ string values ]
        },
        {
            "type": "TWEETS",
            "baseResults": [ values of type tweets ],
            "hasMore": true
        }]
}

I have to serialize & deserialize them all. I want to create something that can hold the values corresponding to baseResults.

there is a main class that represent the whole json

class Data 
{
...
ObservableCollection<Section> sections{get;set;}
...
}

then there is a class that represents the data in sections array of main json

class Section
{
string type{get;set;}// thi elements decides what kind of data would be in baseResults
dynamic baseResults{get;set;} //it should hold ObservableCollection of either Highlights or Tweets etc.
}

base class for type of data coming in baseResults array is an abstract class class CategoryData and its children are class Highlights & class Tweets

I am using dynamic since I can not assign an ObservableCollection<CategoryData> with ObservableCollection<Highlights>. But I don't want to use this dynamic or object type instead I want something relevant. please suggest me what could be a better approach for this problem.

added 100 characters in body
Source Link
Ankit
  • 153
  • 8

this is a kind of data i have to de-serialize

{
    "id": "M:11427",
    "title": "DAX30",
    "nextStartId": "S:727831",
    "sections": [
        {
            "type": "HIGHLIGHTS",
            "baseResults": [ values of type highlights ],
            "hasMore": true
        },
        {
            "type": "CHART",
            "hasMore": false,
            "chartTypes": [ string values ]
        },
        {
            "type": "TWEETS",
            "baseResults": [ values of type tweets ],
            "hasMore": true
        }]
}

I have to serialize & deserialize them all. I want to create something that can hold the values corresponding to baseResults.

there is a main class that represent the whole json

class Data 
{
...
ObservableCollection<Section> sections{get;set;}
...
}

then there is a class that represents the data in sectionsections array of main json

class Section
{
string type{get;set;}// this elements decides what kind of data would be in baseResults
dynamic baseResults{get;set;} //it should hold ObservableCollection of either Highlights or Tweets etc.
}

base class for type of data coming in baseResultsbaseResults array is an abstract class class CategoryData and its children are class Highlights & class Tweets

I am using dynamic since I can not assign an ObservableCollection<CategoryData> with ObservableCollection<Highlights>. But I don't want to use this dynamic or object type instead I want something relevant. please suggest me what could be a better approach for this problem.

this is a kind of data i have to de-serialize

{
    "id": "M:11427",
    "title": "DAX30",
    "nextStartId": "S:727831",
    "sections": [
        {
            "type": "HIGHLIGHTS",
            "baseResults": [ values of type highlights ],
            "hasMore": true
        },
        {
            "type": "CHART",
            "hasMore": false,
            "chartTypes": [ string values ]
        },
        {
            "type": "TWEETS",
            "baseResults": [ values of type tweets ],
            "hasMore": true
        }]
}

I have to serialize & deserialize them all. I want to create something that can hold the values corresponding to baseResults.

there is a main class

class Data 
{
...
ObservableCollection<Section> sections{get;set;}
...
}

then in section

class Section
{
string type{get;set;}
dynamic baseResults{get;set;} //it should hold ObservableCollection of either Highlights or Tweets etc.
}

base class for data coming in baseResults is an abstract class class CategoryData and its children are class Highlights & class Tweets

I am using dynamic since I can not assign an ObservableCollection<CategoryData> with ObservableCollection<Highlights>. But I don't want to use this dynamic or object type instead I want something relevant. please suggest me what could be a better approach for this problem.

this is a kind of data i have to de-serialize

{
    "id": "M:11427",
    "title": "DAX30",
    "nextStartId": "S:727831",
    "sections": [
        {
            "type": "HIGHLIGHTS",
            "baseResults": [ values of type highlights ],
            "hasMore": true
        },
        {
            "type": "CHART",
            "hasMore": false,
            "chartTypes": [ string values ]
        },
        {
            "type": "TWEETS",
            "baseResults": [ values of type tweets ],
            "hasMore": true
        }]
}

I have to serialize & deserialize them all. I want to create something that can hold the values corresponding to baseResults.

there is a main class that represent the whole json

class Data 
{
...
ObservableCollection<Section> sections{get;set;}
...
}

then there is a class that represents the data in sections array of main json

class Section
{
string type{get;set;}// this elements decides what kind of data would be in baseResults
dynamic baseResults{get;set;} //it should hold ObservableCollection of either Highlights or Tweets etc.
}

base class for type of data coming in baseResults array is an abstract class class CategoryData and its children are class Highlights & class Tweets

I am using dynamic since I can not assign an ObservableCollection<CategoryData> with ObservableCollection<Highlights>. But I don't want to use this dynamic or object type instead I want something relevant. please suggest me what could be a better approach for this problem.

added 257 characters in body
Source Link
Ankit
  • 153
  • 8

suggest architecture for classes that maps to json with dynamic data without using dynamic or object reference

this is a kind of data i have to serializede-serialize

{
    "id": "M:11427",
    "title": "DAX30",
    "nextStartId": "S:727831",
    "sections": [
        {
            "type": "HIGHLIGHTS",
            "baseResults": [ values of type highlights ],
            "hasMore": true
        },
        {
            "type": "CHART",
            "hasMore": false,
            "chartTypes": [ string values ]
        },
        {
            "type": "TWEETS",
            "baseResults": [ values of type tweets ],
            "hasMore": true
        }]
}

I have to serialize & deserialize them all. I want to create something that can hold the values corresponding to baseResults.

there is a main class

class Data 
{
...
dynamicObservableCollection<Section> sections{get;set;}
...
}

then there is a base classin section

class Section
{
string type{get;set;}
dynamic baseResults{get;set;} //it should hold ObservableCollection of either Highlights or Tweets etc.
}

base class for data coming in baseResults is an abstract class class CategoryData and its children   are class Highlights & class Tweets

I am using dynamic since I can not assign an ObservableCollection<Section>ObservableCollection<CategoryData> with ObservableCollection<Highlights>. But I don't want to use this dynamic or object type instead I want something relevant. please suggest me what could be a better approach for this problem.

suggest architecture for classes that maps to json with dynamic without using dynamic or object reference

this is a kind of data i have to serialize

{
    "id": "M:11427",
    "title": "DAX30",
    "nextStartId": "S:727831",
    "sections": [
        {
            "type": "HIGHLIGHTS",
            "baseResults": [ values of type highlights ],
            "hasMore": true
        },
        {
            "type": "CHART",
            "hasMore": false,
            "chartTypes": [ string values ]
        },
        {
            "type": "TWEETS",
            "baseResults": [ values of type tweets ],
            "hasMore": true
        }]
}

I have to serialize & deserialize them all. I want to create something that can hold the values corresponding to baseResults.

there is a main class

class Data 
{
...
dynamic sections{get;set;}
...
}

then there is a base class

class Section

its children  class Highlights & class Tweets

I am using dynamic since I can not assign an ObservableCollection<Section> with ObservableCollection<Highlights>. But I don't want to use this dynamic or object type instead I want something relevant. please suggest me what could be a better approach for this problem.

suggest architecture for classes that maps to json with dynamic data without using dynamic or object reference

this is a kind of data i have to de-serialize

{
    "id": "M:11427",
    "title": "DAX30",
    "nextStartId": "S:727831",
    "sections": [
        {
            "type": "HIGHLIGHTS",
            "baseResults": [ values of type highlights ],
            "hasMore": true
        },
        {
            "type": "CHART",
            "hasMore": false,
            "chartTypes": [ string values ]
        },
        {
            "type": "TWEETS",
            "baseResults": [ values of type tweets ],
            "hasMore": true
        }]
}

I have to serialize & deserialize them all. I want to create something that can hold the values corresponding to baseResults.

there is a main class

class Data 
{
...
ObservableCollection<Section> sections{get;set;}
...
}

then in section

class Section
{
string type{get;set;}
dynamic baseResults{get;set;} //it should hold ObservableCollection of either Highlights or Tweets etc.
}

base class for data coming in baseResults is an abstract class class CategoryData and its children are class Highlights & class Tweets

I am using dynamic since I can not assign an ObservableCollection<CategoryData> with ObservableCollection<Highlights>. But I don't want to use this dynamic or object type instead I want something relevant. please suggest me what could be a better approach for this problem.

edited title
Source Link
Ankit
  • 153
  • 8
Loading
Source Link
Ankit
  • 153
  • 8
Loading