Generic class to CSV (all properties)

前端 未结 5 1175
梦如初夏
梦如初夏 2021-02-13 02:42

Im looking for a way to create CSV from all class instances.

What i want is that i could export ANY class (all of its instances) to CSV.

Can some1 direct me to p

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-13 03:07

    Actually, something similar has been addressed here:

    Best practices for serializing objects to a custom string format for use in an output file

    Is this useful to you?

    There is a sample that uses reflection to pull out the field names and values and append them to a string.

提交回复
热议问题