Cast a property to its actual type dynamically using reflection

后端 未结 7 1003
梦毁少年i
梦毁少年i 2020-12-09 08:29

I need to cast a property to its actual type dynamically. How do I/Can I do this using reflection?

To explain the real scenario that I am working on a bit. I am tryi

7条回答
  •  余生分开走
    2020-12-09 09:04

    How about setting the root value as a string and then carry it around as a string until you need to convert it to the target type?

提交回复
热议问题