ExpandoObject it like a expand property in HTML. Microsoft introduces new class
ExpandoObject. It's really dynamic object. It is part of DLR (dynamic language
The ExpandoObject class enables you to add and delete members of its instances
at run time and also to set and get values of these members. This class supports
dynamic binding, which enables you to use standard syntax like
sampleObject.sampleMember instead of more complex syntax like
Purpose: To create a runtime instance of any type. You can add
properties, methods, and events to instances of the ExpandoObject class.
Here we are creating dynamic instance.
Employee = new ExpandoObject();
Employee.ID = 1;
Employee.Name = "Amit";
Employee.Salary = 10000;
Nested dynamic instance
Employee.Addess = new ExpandoObject();
Employee.Addess.City = "Pune";
Employee.Addess.Country = "India";
Employee.Addess.PinCode = 456123;
Bind dynamic Event
Employee.Click += new EventHandler(SampleHandler);
//throw new NotImplementedException();
parameter as dynamic.
//you can write your logic