dotnetcore / dotnetcore/FreeSql

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

Open
#2,255 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
4.4k
Forks
910
PR merge metrics
No merged PRs in 30d

Description

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

我的类当为这个会报错
```
[JsonMap]
public List 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种格式,对象`{}`和数组`[]`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the JsonMap failure with the shown List property and compare it with the working Test1 property. Trace the JsonMap conversion path around the “Object serialized to Array” exception. Done means array and List values map successfully while existing object mapping continues to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, postgresql
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.