updateWithChildren sqlite.net扩展名不要替换旧元素



我正在使用sqlite扩展名来创建DB。OneToOne关系和许多关系关系正常,我使用InsertorReplaceWithChildren来管理新的和修改的元素。但是,当涉及到OneTomany关系时,我有一些问题。遵循SQLite-net扩展手册,我在父级中添加了此内容:

[PrimaryKey, AutoIncrement]
    public int ID_child { get; set; }
...
[OneToMany(CascadeOperations = CascadeOperation.All)]
    public List<ClinicalTest> ClinicalTests_DB { get; set; }

这在我的孩子班上:

[PrimaryKey, AutoIncrement]
    public int ID_clinicaltest { get; set; }
[ForeignKey(typeof(Child))]
    public int ID_child { get; set; }

问题是,如果我更改临床测试中的某些元素字段,并且我称updateWithChildren(sudclassInstance)或InsertorReplacewithChildren(sudclassInstance),结果是在临床测试表中,我有两个行:一个是更新的元素(一个是更新的元素(具有正确的offingkey),一个是旧元素(没有任何前键)。
我本来可以预计更新的元素只有一排。我做错了吗?
我应该手动清洁这些无用的元素吗?
谢谢,
Alex

没事,对不起。
在我的代码中,临床测试的ID在某些段落中"丢失"。那是问题的原因。

最新更新