简体   繁体   English

使用RefactorThis.GraphDiff库

[英]Using RefactorThis.GraphDiff library

I have the following tables in my database 我的数据库中有以下表格

在此处输入图片说明

And a graph mapping of (table address not shown in image) : (表地址未在图中显示)的图形映射:

.OwnedEntity(s => s.Address)
.OwnedCollection(s => s.SiteActivityPlants)
.OwnedCollection(s => s.SiteActivityPlants, with => with.AssociatedCollection(d => d.SiteActivityPlantNotes))

What I am trying to do is update the data in table SiteActivityPlantNotes. 我正在尝试做的是更新表SiteActivityPlantNotes中的数据。

After looking at Documentation , AssociatedCollection just updates the reference, what I need to do is update the data records within SiteActivityPlantNotes. 在查看Documentation之后 ,AssociatedCollection只是更新了引用,我需要做的是更新SiteActivityPlantNotes中的数据记录。

Is this possible? 这可能吗?

2 Changes in your code should do it: 2在代码中进行更改应执行以下操作:

  • Removed second line ".OwnedCollection(s => s.SiteActivityPlants)" as it is already part of the third line 删除了第二行“ .OwnedCollection(s => s.SiteActivityPlants)”,因为它已经是第三行的一部分
  • Changed in third line "with.AssociatedCollection" to "with.OwnedCollection" 将第三行“ with.AssociatedCollection”更改为“ with.OwnedCollection”

Final Code: 最终代码:

.OwnedEntity(s => s.Address)
.OwnedCollection(s => s.SiteActivityPlants, with => with.OwnedCollection(d => d.SiteActivityPlantNotes))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM