mongodb - c# repository pattern to support normalized mongo db -
I am starting to learn mangodibi and I am trying to create a repository pattern in C # that is the normalized data model Can support as it has been presented in this.
I have a few questions about how I should do this.
- Do I want to save the object property first before saving the original object?
- While questioning, should I first query the object properties and then connect them to the original object through the code?
So far, my current repository saves the pattern code and queries the embedded model and I do not like it. Hopefully you can tell me some ideas how to create a repository pattern supporting a normalized model. Thank you :)
This shows a good way to apply the repository pattern to C #. The objective is to hide how the object is formed and to limit the data access codes for a set of tables or tables for any location.
Usually, a repository will fully populate your objects so that any collections of other objects are properly populated. If you have a separate store for parents unit, then you need to save that unit in the database before saving your children. Unless your repository can save parents and child objects at the same time.
The repository plate can definitely support generalization, though it usually depends on how you install your object hierarchy.
Comments
Post a Comment