-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to save related data from a service? #37
Comments
If I understood your question, this could help you (same question i've asked some time ago): |
Yes I concur with @Crazybutch — you can do graph updates with URF support for my Trackable Entities framework. |
Let me know if you need further assistance and I’ll re-open. |
Would you give me a quick sample please of how setting a trackable property on objects in the graph? |
Also, does trackable property take care of Update/Insert/Delete? |
If you use the Trackable URF packages and derive your entities from the base Then in your API all you have to do is call |
Work very well, thank you !! :) |
Took me a while to figure this out, so for everyone else: If you are working with OData (like i do) the TrackingState is not automatically added as a property of your model/entity. You have to do this by hand via the ODataConventionModelBuilder:
|
Hello, is this possible to save related data without the need of creating a service for each children entities?
Let's say you have this post entity:
In order to save it all, I have to create a PostService, PostTranslationService, PostFieldService and a PostFieldTranslationService class. They all have in common an insert method.
Then I have to call them all from PostService:
First => this.Insert(post);
Then => postTranslationService.Insert(post.PostTranslations);
And then => postFieldService.Insert(post.PostFields, postFieldTranslationService);
I wonder if there is a way to tell EntityFramework with URF.Core to insert them all from this.Insert(post).
The version I use from now is 1.0.0-rc1.
Thank you for any advice,
David
The text was updated successfully, but these errors were encountered: