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

LM Studio is a desktop application designed for developing and experimenting with large language models (LLMs) directly on your computer.

    LM Studio Overview LM Studio is a desktop application designed for developing and experimenting with large language models (LLMs...