Click here to Skip to main content
15,884,629 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have class structure like as follows


C#
public Class myClass
      {
 
   public IDictionary<string, Newtonsoft.Json.Linq.JToken> ExtensionData { get; set; }
      }


how do i create object of myClass and Populate ExtensionData ?

Please suggest different ways of populating ExtensionData while creating
object of myClass ?

What I have tried:

I have tried

C#
myclass objMyclass = new myclass();
					objMyclass.ExtensionData = = new Dictionary<string, JToken>
                           {
                                 { "Mydata", JToken.FromObject(new { mycode = "456", MyResult = "result" }) }
                           }
                        });
Posted
Updated 4-Feb-17 5:05am
v2

1 solution

Remove the "spare" equals sign:
objMyclass.ExtensionData = = new Dictionary<string, JToken>

Becomes:
objMyclass.ExtensionData = new Dictionary<string, JToken>
 
Share this answer
 
Comments
Member 10004269 4-Feb-17 11:11am    
yes OriginalGriff but how do i populate this object ?

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