vendredi 28 juin 2019

Get property names from class method

Is there a way to get the names of the properties inside the GetPKs method? maybe using reflection?

so in the example below I need to somehow get an object[] that returns "Id", "Id2". Not the values but the Id names

public class MyClass
{
    public object[] GetPKs() => new object[] { Id, Id2 };
}





Aucun commentaire:

Enregistrer un commentaire