vendredi 12 avril 2019

Method to get fields and properties by using reflection c#

i use two arrays in my code:

 var fields = typeof(MyDtoClass).GetProperties();
 var fieldsOfDtoClass = typeof(MyDtoClass).GetFields(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);

but i using this to generate one table and it is possible to out of sync. How can i use one array, but can get in one place properties, and in another place fields this such flags? should i look in GetMembers or smth? any help is much appreciated





Aucun commentaire:

Enregistrer un commentaire