cms icon indicating copy to clipboard operation
cms copied to clipboard

插件开发,数据库字段使用问题求助

Open fsea opened this issue 1 year ago • 2 comments

数据库: image

Model: image

定义如上图,public List<WorkflowStep> Steps { get; set; }这里在调用时读取或写入,都会报错不支持,我想把List对象以文本写入数据表中的Steps字段,并能够从数据库中取出时自动序列化为List对象,应该要如何实现呢?

fsea avatar Jan 11 '24 03:01 fsea

用[JsonConverter(typeof(StringEnumConverter))]也不行

fsea avatar Jan 11 '24 03:01 fsea

建议将对象数组类型改为字符串类型,get或者set的时候通过Json转换一下。

starlying avatar Jan 15 '24 00:01 starlying