In C# is there a way retrieve only built-in data type properties using reflection

后端 未结 2 545
花落未央
花落未央 2021-01-13 13:20

Using reflection I\'d like to retrieve only the built-in data type properties from a C# object. Is there a better way to do that then using a bunch of || (ors)

2条回答
  •  醉话见心
    2021-01-13 13:52

    They are all in the System namespace, so you could at least filter to namespace, other than that, at least the list isn't too long. You wouldn't chain Where's either, you'd use ||'s, that code won't work.

提交回复
热议问题