Thursday, April 26, 2012

Call an Object Member Dynamically

Why it is required ?????

You need to call method or property dynamically....

What you can do for that????

Simple : Use dynamic keyword, this will disable the static checking for an object instance.

What is the logic behind it??? you know ha ha no right  ?? if yes you wouldn't be here :)




C# supports dynamic calls to type members in which these checks are not performed until the program is running and the call needs to be made.

You can do it as follows :


dynamic myobject = new MyObject();


No comments:

Post a Comment

Thank you for Commenting Will reply soon ......

Featured Posts

#Linux Commands Unveiled: #date, #uname, #hostname, #hostid, #arch, #nproc

 #Linux Commands Unveiled: #date, #uname, #hostname, #hostid, #arch, #nproc Linux is an open-source operating system that is loved by millio...