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

🎬 Installing Kali Linux on a Virtual Machine | Step-by-Step Guide 🐧

🎬 In this video, I’ll show you how to install Kali Linux 🐧 inside a Virtual Machine step-by-step! Whether you're a beginner curious...