The .NET assembly not only contains code, but also contains metadata that describes the code.
In the case of a method, metadata is generated that describes the name of the method, signature, etc.
In the case of property X it is compiled as a bunch of access methods ( get_X and / or set_X ), and metadata of the usual method is generated for each of them. Then additional metadata is generated that indicates that all these access methods actually belong to each other as one logical object (property).
Now back to your example: if you define a method called get_Boolean using C #, the C # compiler will only emit method metadata, but no additional property metadata. Essentially, the compiler chooses which metadata to emit. And since you did not use the C # syntax for the property, but the method declaration syntax, what the C # compiler will generate metadata for.
Metadata is described in detail in the ECMA 335 standard , which describes the CLI platform (.NET). See the section in chapter II.22.34 on page 241 for an explanation of how property metadata works.
stakx
source share