- 
                Notifications
    
You must be signed in to change notification settings  - Fork 5.2k
 
Closed
Labels
api-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-System.Reflection.Metadatain-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is merged
Milestone
Description
Background and motivation
S.R.Metadata provides a way to get the owning type of fields and methods. It doesn't provide an API to get owning type of properties and events. I think it should be exposed for parity.
The lookup strategy is similar (a binary search in one of the tables).
API Proposal
namespace System.Reflection.Metadata
{
    public struct PropertyDefinition
    {
        public TypeDefinitionHandle GetDeclaringType();
    }
    public struct EventDefinition
    {
        public TypeDefinitionHandle GetDeclaringType();
    }
}API Usage
PropertyDefinition someProperty = ...;
var owningType = someProperty.GetDeclaringType();Risks
No response
jkoritzinsky, pedoc, mateoatr, MSDN-WhiteKnight and slang25
Metadata
Metadata
Assignees
Labels
api-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-System.Reflection.Metadatain-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is merged