The framework version defines only those classes and methods of the library that you can access. var is a fully compiled concept. These two lines are compiled in exactly the same IL:
var str = String.Empty; string str = String.Empty;
Similarly, automatic properties are fully compiled. It:
private string <>SomeRandomName; public string Prop { get { return <>SomeRandomName; } set { <>SomeRandomName = value; } }
and this:
public string Prop { get; set; }
create exactly the same IL (modulo variable names and attributes).
These functions are independent of the classes and methods available in the mscorlib assembly
thecoop
source share