C#: How to get all public (both get and set) string properties of a type

前端 未结 7 709
借酒劲吻你
借酒劲吻你 2020-12-02 14:21

I am trying to make a method that will go through a list of generic objects and replace all their properties of type string which is either null or

7条回答
  •  有刺的猬
    2020-12-02 14:36

    I suggest a different approach: AOP.
    You can intercept the setter and set the desired value to a valid one. With PostSharp it's quite easy.

提交回复
热议问题