Menu
  • HOME
  • TAGS

Can GraphDiff be used for partial updates of simple entities too?

c#,entity-framework,asp.net-web-api2,graphdiff

In the above-mentioned scenario: As above Server maps from dto to model and passes model to service/repository Graphdiff will load the model before updating and will take care of changed properties accordingly Graphdiff will return the updated entity ...

Empty rows insertion in Many-to-One and Many-to-Many relationships in GraphDiff

c#,entity-framework,ef-code-first,graphdiff

What I finally applied as a workaround, was to perform the update operation by splitting it into multiple UpdateGraph calls with graph depth less than or equal to 2 and apply manually any sub-node addition to the graph: //Update food in total graph depth <= 2. db.UpdateGraph(food, map => map.AssociatedCollection(f...

Optimize GraphDiff performance on first update (subsequent updates are quick)

entity-framework-6.1,graphdiff

I solved it by cloning the GraphDiff source code from GitHub and modifying it. GraphDiff detects dynamically the keys of the entities, and because the way how the dynamic query expressions are generated to retrieve the already persisted objects, the expression are recompiled by EF every time when a new...

How to update related entities using GraphDiff?

c#,entity-framework,ef-code-first,graphdiff

GraphDiff basically distinguishes two kinds of relations: owned and associated. Owned can be interpreted as "being a part of" meaning that anything that is owned will be inserted/updated/deleted with its owner. The other kind of relation handled by GraphDiff is associated which means that only relations to, but not the...

Inserting entity doesn't update Key field

c#,entity-framework,graphdiff

Well I found out right before posting the question that UpdateGraph had a return type and that I did not use it.. If you don't use the returned entity, the entities states will be well updated but the entity tracking will totally fail. Changing my AddObject to this solved the...

Resolving class that has extension methods with AutoFac

entity-framework,autofac,graphdiff

Extensions methods are not part of the type, it is a C# syntactic sugar. When you do : myContext.ExtensionMethod(); the compiler will generate the following code : ExtensionContainer.ExtensionMethod(myContext); Where ExtensionContainer is defined like this : public static class ExtensionContainer { public static void ExtensionMethod(this DbContext context) { } } When...