1

I am looking to create a dictionary type of object from below string without using any extension class. I would prefer to write a .net class which will do serialize and deserialize it.

string userDetails = "{"FullName":"Manoj Singh","username":"Manoj","Miles":2220,"TierStatus":"Gold","TierMiles":23230,"MilesExpiry":12223,"ExpiryDate":"31 January 2011","PersonID":232323,"AccessToken":"sfs23232s232","ActiveCardNo":"232323223"}";

I have got above string in my results, now I want to convert it into dictionary type of Object using .NET 2.0.

Thanks.

2 Answers 2

2

I was waiting since many days to have any response on it, unfortunately there were no response, well guys I resolved my problem with the help of this question Can you Instantiate an Object Instance from JSON in .NET?

Thanks to all you who have seen this question!

Sign up to request clarification or add additional context in comments.

Comments

1

try this!!

Class deserialize<Class>(string jsonStr, Class obj) { /* ... */}

 var jstring = "{fname='Test', lname='test, oth='test'}";
 var p     = deserialize(jstring, new {fname="",lname=""});
 var x     = person.fname; //strongly-typed

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.