...compared to plainly returning an object. The magic starts when you assign an object to a dynamic declared variable, so what does returning a dynamic make a difference?
So what is the difference between:
static object CreateMagicList()
{
return new List<string>();
}
and
static dynamic CreateMagicList()
{
return new List<string>();
}
They both seem to work exactly the same, in example:
dynamic list = CreateMagicList();
list.Add( "lolcat" );
Note that this is not a practical question. I'm interested in the why part :)