Friday, June 2, 2017

Adding dynamic properties and values to the c# Object

Adding dynamic properties and values to the c# Object:

Below C# code snippet allows to add dynamic properties and values to the c# object dynamically..




            var expandoObject = new ExpandoObject();
            var myObject = expandoObject as IDictionary<String, object>;
            myObject ["youtPropertyName"] = "yourvalue";
            

No comments:

Post a Comment