
Usi “strani” del linguaggio
A prima vista a nulla, soprattutto il parametro “obj” che viene completamente ignorato…IListCreate ( T obj )
{
return new List();
}

Allora potremmo dire che anche questo funziona:static void Main( string[] args )
{
var a = new { SampleProperty = "mauro" };
var b = new { SampleProperty = "mauro" };
Console.WriteLine( a.GetType() == b.GetType() ); //true...
Console.WriteLine( a.GetType().IsAssignableFrom( b.GetType() ) ); //true...
Console.WriteLine( b.GetType().IsAssignableFrom( a.GetType() ) ); //true...
Console.Read();
}
Figostatic void Main( string[] args )
{
var list = Create( new { SampleProperty = "" } );
list.Add( new { SampleProperty = "mauro" } );
var item = list.First();
Console.WriteLine( item.SampleProperty );
Console.Read();
}

.m