TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Anurag Malani
NA
80
34.4k
How to deserialize a object type class in linq
May 25 2014 6:09 AM
Hi All,
My Qus is how can we deserialize "Scorers" object type class by LINQ, bcoz some time "Scorers => home & away" data is blank like a string and some times it contains data in array form with the Scorers names..
below is my class and json data, Please help...
My Class -
public class Scorers
{
public object home { get; set; }
public object away { get; set; }
}
public class Schedule
{
public Scorers scorers { get; set; }
}
public class Matches
{
public List<Schedule> schedules { get; set; }
}
public class RootObject
{
public Matches matches { get; set; }
}
My json -
{
"matches": {
"schedules": [
{
"scorers": {
"home": "",
"away": ""
}
},
{
"scorers": {
"home": "",
"away": ""
}
},
{
"scorers": {
"home": [
{
"name": "ABC",
},
{
"name": "DEF",
}
],
"away": [
{
"name": "PQR",
},
{
"name": "STU",
}
]
}
}
]
}
}
Reply
Answers (
1
)
Left join LINQ
Grouping on dynamic columns in LINQ to SQL