namespaceSystem.Runtime.CompilerServices { ///<summary> /// Reserved to be used by the compiler for tracking metadata. This class should not be used by developers in source code. ///</summary> [EditorBrowsable(EditorBrowsableState.Never)] publicsealedclassIsExternalInit { } } #endif
.method public hidebysig specialname instance voidmodreq([System.Runtime]System.Runtime.CompilerServices.IsExternalInit) set_InitOnlyProperty(string'value') cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01000000 ) // 代码大小 8 (0x8) .maxstack 8 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: stfld string InitOnlyProperty.Program/Sample::'<InitOnlyProperty>k__BackingField' IL_0007: ret } // end of method Sample::set_InitOnlyProperty
.method public hidebysig specialname rtspecialname instance void .ctor() cil managed { // 代码大小 8 (0x8) .maxstack 8 IL_0000: ldarg.0 IL_0001: call instance void [System.Runtime]System.Object::.ctor() IL_0006: nop IL_0007: ret } // end of method Sample::.ctor
.property instance stringInitOnlyProperty() { .get instance string InitOnlyProperty.Program/Sample::get_InitOnlyProperty() .set instance voidmodreq([System.Runtime]System.Runtime.CompilerServices.IsExternalInit) InitOnlyProperty.Program/Sample::set_InitOnlyProperty(string) } // end of property Sample::InitOnlyProperty } // end of class Sample