dotnetcore / dotnetcore/FreeSql
postgre 插入或更新 相关问题
- Dominant language
- C#
- Stars
- 4.4k
- Forks
- 910
- PR merge metrics
- No merged PRs in 30d
Description
#### 问题描述及重现代码:
```c#
public async Task Te()
{
try
{
TestClass c = new TestClass() { a = "123" };
var data = new TestTable() { j = JObject.FromObject(c),id=1,t=c };
//正常
await db.InsertOrUpdate().SetSource(data).ExecuteAffrowsAsync();
//System.NullReferenceException: Object reference not set to an instance of an object.
await db.InsertOrUpdate().SetSource(data).ExecutePgCopyAsync();
//有jsonmap 字段t 不加NoneParameter()报错 图1为错误信息
//去掉jsonmap 字段t 不管加不加NoneParameter()都报错 图2为错误信息
await db.Insert()
.NoneParameter()
.OnConflictDoUpdate()
.ExecuteAffrowsAsync();
}catch (Exception e)
{
Debugger.Break();
}
}
[Table(Name = "test")]
public class TestTable
{
[Column(IsPrimary = true)]
public int id { get; set; }
public JObject j { get; set; }
[JsonMap]
public TestClass t { get; set; }
}
public class TestClass
{
public string a { get; set; }
}
```


#### 数据库版本
3.5.202
#### 安装的Nuget包
#### .net framework/. net core? 及具体版本
.net9
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.