question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Suggestion] Abp.GraphDiff package

See original GitHub issue

Hello @hikalkan , What do you think about creating Abp.GraphDiff package, which would allow to attach a detached entities/graphs to a context? I’m currently using GraphDiff in combination with OData and it works like a charm because updating of navigation properties are handled by GraphDiff. Let me know if you are open to such contribution and If you want I will spend some spare time to prepare an integration package, which includes the things, which are needed to make GraphDiff work out-of-the-box:

  1. Some entity mapping storage for saving all of the mappings with a convenient API.
  2. Custom pre-build repository which Adds/Updates entities as a whole graphs via GraphDiff.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:30 (26 by maintainers)

github_iconTop GitHub Comments

1reaction
4nonym0uscommented, Aug 24, 2016

@maharatha , You can check out sample application, which is used in unit tests, to find out how it works.

Here is the little guide:

  1. Install a corresponding Nuget-package into YourCompany.EntityFramework project and add a dependency on this package into EntityFrameworkModule.cs using DependsOn annotation. Example.
  2. Add the module and configure the entity mappings for the GraphDiff. Example.
    2*. You should use the extension MappingExpressionBuilder.For<TEntity>(configuration => ...) to create new mappings.
    2**. You can find more about mappings syntax here. You use AssociatedCollection() or AssociatedEntity() to map a navigation property, but if you want to make a “deeper” mapping you firstly use the OwnedCollection() or OwnedEntity() methods.
  3. Now you are ready AttachGraph() extension. This method uses the mapping configuration, which was set up in step 2. In a case, you didn’t provide any mapping, it will simply use null mapping, which means that mapping weren’t provided (it’s default GraphDiff value for mapping). Example1, Example2.

That’s it: only 3 steps to handle the detached graph attachment in EF6 using Abp. Let me know if you have any further questions or you still need a sample project.

0reactions
4nonym0uscommented, Oct 12, 2020

AbpZeroEntityFrameworkModule is module for EF6 and it’s correct to depend on it if you are using EF6. AbpEntityFrameworkCoreModule is module for EF Core. GraphDiff integration depends on EF6 and it’s the only EntityFramework module you can reference. You neither can nor should try to use GraphDiff with EF Core hence it’s functionality is already present in EF Core out of the box.

I added a Reference in my Application project to the EntityFramework project, but that made no difference so I removed it.

You must have it to resolve GraphDiff extension methods; otherwise, you will have that exact issue you’ve described in your previous message. Add the reference to EntityFramework from your Application Project, build solution, enjoy using GraphDiff.

I noticed in your example configs that you had GraphDiff installed in the same module you have AutoMapper installed in. My AutoMapper is installed in the Application module. GraphDiff is installed in the EntityFramework module.

AutoMapper is not related to the issue for sure and your module dependencies are correct.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Abp.EntityFramework.GraphDiff 8.3.1
Version Downloads Last updated 8.3.1 43 6 days ago 8.3.0 40 6 days ago 8.2.0 133 3 months ago
Read more >
Entity Update issue with sub-entity #2501
Support Team. Hi,. As far as I know Entity Framework is not very good at sub entity updates. ABP has a package named...
Read more >
Simple index
... wix-protos-partners-partners-site-connect menpocli leodatacenter-package ... odoo12-addon-sale-order-product-recommendation-secondary-unit django-xtc ...
Read more >
sitemap_package_4.xml
Recommendation 2023-08-14 https://nugetmusthaves.com/package/Crosslight.Xamarin.Android.Support.Vector.
Read more >
2m-subdomains.txt
... parquet-pig tdb Abp WaveEngine donomo mockery slidify elm-package pre-public ... centos-postgres ExperimentalTools suggestions TransportsBordeaux vundle ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found