It creates anonymous class object with one field called id
. Look on msdn for details. Once you create object it cannot be extended.
This what this class looks like when open with .net Reflector
[CompilerGenerated, DebuggerDisplay(@"\{ id = {id} }", Type="<Anonymous Type>")]
internal sealed class <>f__AnonymousType0<<id>j__TPar>
{
// Fields
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private readonly <id>j__TPar <id>i__Field;
// Methods
[DebuggerHidden]
public <>f__AnonymousType0(<id>j__TPar id);
[DebuggerHidden]
public override bool Equals(object value);
[DebuggerHidden]
public override int GetHashCode();
[DebuggerHidden]
public override string ToString();
// Properties
public <id>j__TPar id { get; }
}
So its compiled to regular class the basic difference is that it cannot be used outside of method scope.