Skip to content

【bug】PostgreSQL中使用 JsonMap 不支持数组(Array)和集合(List) #2255

Description

@ping9719

JsonMap 希望支持数组(Array)和集合(List)

我的类当为这个会报错

        [JsonMap]
        public List<ProcessInfo> ProcessInfo { get; set; }

错误信息

System.ArgumentException:“ExpressionTree 转换类型错误,值(System.Collections.Generic.List`1[aBaseUi.ProcessInfo]),类型(System.Collections.Generic.List`1[[aBaseUi.ProcessInfo, aBaseUi, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]),目标类型(Newtonsoft.Json.Linq.JObject),Object serialized to Array. JObject instance expected.”

关键信息为
Object serialized to Array. JObject instance expected.

于是我猜测框架不支持数组和集合,于是用Test1做测试没有问题。

        [JsonMap]
        public Test1 ProcessInfo { get; set; }

我希望JsonMap 支持数组(Array)和集合(List),这是json最基础的2种格式之一,json只有2种格式,对象{}和数组[]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions