Comments (3)
Hello @fdahlberg ,
Thank you for reporting,
We will investigate this issue very soon and give you an answer.
Best Regards,
Jonathan
Help us to keep this library free: Donate
from graphdiff.
Hello @fdahlberg ,
We have a lot investigated this issue to better understand why this is happening.
We find out that the issue is caused by this method: https://github.com/zzzprojects/GraphDiff/blob/master/GraphDiff/GraphDiff/Internal/Graph/GraphNode.cs#L106-L122
protected static void AttachCyclicNavigationProperty(IObjectContextAdapter context, object parent, object child)
{
if (parent == null || child == null) return;
var parentType = ObjectContext.GetObjectType(parent.GetType());
var childType = ObjectContext.GetObjectType(child.GetType());
var navigationProperties = context.GetNavigationPropertiesForType(childType);
var parentNavigationProperty = navigationProperties
.Where(navigation => navigation.TypeUsage.EdmType.Name == parentType.Name)
.Select(navigation => childType.GetProperty(navigation.Name, BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public))
.FirstOrDefault();
if (parentNavigationProperty != null)
parentNavigationProperty.SetValue(child, parent, null);
}
The child is an object of the original entity which gets assigned the parent of the new entity.
We tested some scenario which could make existing
child entities work but unfortunately for new entities, there is nothing we have found that we can do for now.
Removing this code will lead to more issue since some navigation property will not be correctly copied.
We can leave this issue open but I don't think we will do something until we choose to re-write this library.
Let me know if you need a better explanation of the issue.
Best Regards,
Jonathan
Help us to keep this library free: Donate
from graphdiff.
Hi Jonathan,
Thanks for investigating. It's a shame it can't be fixed but I can live with this. As a workaround I create a clone of the incoming object before using UpdateGraph.
Thanks
Fred
from graphdiff.
Related Issues (20)
- Update grandchild, where child is linktable
- Merge entity graph from database perspective
- GraphDiff support for EntityFramework Core? HOT 16
- What about transferring the project to somebody who have the inclination to maintain it? HOT 10
- when calling GetPrimaryKeyFieldsFor function
- How to Ignoring one or more fields HOT 7
- Update error when a table has two foreign keys pointing to the same table HOT 24
- I can't build it due to "zzzproject.pfx" HOT 4
- All tests fail, in the test project. HOT 1
- Problem in inheritance with aggregation HOT 2
- Description URL broken HOT 1
- Partially update owned collection HOT 9
- Autoincrement Id is not read back [not an issue or question] HOT 2
- Deleting join row only in a many to many scenario HOT 3
- Is this project still supported? HOT 11
- We need GraphDiff for EFCore HOT 7
- Description link is broken / documention not available HOT 4
- Data corruption when fixing up navigation properties HOT 10
- Associated Collection reference being update with parent
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphdiff.