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

🌫️ Project Title: "Fog Buster – AI-Powered Visibility Enhancement System"

🔍 Project Vision: To design a device that allows vehicles (cars, trucks) and aircraft (planes, helicopters, drones) to see clearly during f...