Click here to Skip to main content
15,886,788 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
After I deserialize i am unable to retrieve the value of x.args, getting exception as:
C#
Object of type 'System.Dynamic.ExpandoObject' cannot be converted to type 'DynaProxy.EventService.Args.BaseEventArgs


What I have tried:

C#
dynamic obj = new ExpandoObject();
obj.Name = "T"; obj.args = new BaseEventArgs(25, 500); obj.id = Guid.NewGuid();
		  
String message=Newtonsoft.Json.JsonConvert.SerializeObject(obj));
dynamic x = JsonConvert.DeserializeObject<expandoobject>(message, new ExpandoObjectConverter());
Posted
Updated 29-Aug-16 7:48am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900