static void Main(string[] args)
{
dynamic
{
object myDynamicObject = GetDynamicObject();
myDynamicObject.SomeMethod(); // call a method
myDynamicObject.someString = "value"; // Set a field
myDynamicObject[0] = 25; // Access an indexer
}
}
How cool is it? I don’t know, probably will be something dangerous if not used with care, C# depend a lot of compile time checking.
To see more about this see Charlie Calvert’s Blog
No hay comentarios.:
Publicar un comentario