Using JavaScriptSerializer Deserialze array of generic object in C?

Stackoverflow Rocks. Found answer from this question(though below question was bit dfferent from mine): How to dynamically create generic C# object using reflection? I modified my code like this: foreach (CloudDBTableList table in cloudDBTableList) { string uri = string.

Format(table. URI, "1-Jan-2011"); string result = _dataPullSvcAgent. GetData (baseURI + uri); string tableClassType = namespacePrefix + "." + table.

SchemaName + ". " + table. TableName + ", " + namespacePrefix;//namespacePrefix is same as assembly name.

Type t = Type. GetType(tableClassType); JavaScriptSerializer jsonDeserializer = new JavaScriptSerializer(); var L1 = typeof(List); Type listOfT = L1. MakeGenericType(t); var objectList = jsonDeserializer. Deserialize(result, listOfT); }.

Stackoverflow Rocks. Found answer from this question(though below question was bit dfferent from mine):- How to dynamically create generic C# object using reflection? I modified my code like this:- foreach (CloudDBTableList table in cloudDBTableList) { string uri = string.

Format(table. URI, "1-Jan-2011"); string result = _dataPullSvcAgent. GetData (baseURI + uri); string tableClassType = namespacePrefix + "." + table.

SchemaName + ". " + table. TableName + ", " + namespacePrefix;//namespacePrefix is same as assembly name.

Type t = Type. GetType(tableClassType); JavaScriptSerializer jsonDeserializer = new JavaScriptSerializer(); var L1 = typeof(List); Type listOfT = L1. MakeGenericType(t); var objectList = jsonDeserializer. Deserialize(result, listOfT); }.

You should be able to do something like this: JavaScriptSerializer jsonDeserializer = new JavaScriptSerializer(); List list= jsonDeserializer. Deserialize>(cloudDBTableList).

Actually, from CloudDBTableList, each row is giving me different C# Class names, and URI, I am calling those URI, and URI is returning me List of of that class name, but how should I create List in above code is my question. – Sutikshan Dubey Aug 9 at 11:53 @Sutikshan Dubey I see, in that case I'll let someone else answer your question but my impression is that you can't to that. The only way -that I know of- to do something like that is just have a List because List has to be the same type of T – Icarus Aug 9 at 12:05 yes in single iteration all T of List will be of same type.In each iteration, it will return List where T is of type created from info on row of CloudDBTableList table.

– Sutikshan Dubey Aug 9 at 12:16 finally found the answer here stackoverflow. Com/questions/1151464/… – Sutikshan Dubey Aug 9 at 12:39 Thank you for sharing the link. Very interesting.

– Icarus Aug 9 at 13:06.

String result = _dataPullSvcAgent. String tableClassType = namespacePrefix + "." + table. SchemaName + "." + table.

TableName + ", " + namespacePrefix;//namespacePrefix is same as assembly name. Type t = Type. Type listOfT = L1.

Var objectList = jsonDeserializer.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions