Best Persistence Practice #1197
Unanswered
Enxyphered
asked this question in
Q&A
Replies: 1 comment 1 reply
-
My initial guess would be that we have our own UnitType enum that lists all the types of units relevant to our program. For each UnitType we also have Enum for the Units under that UnitType. Now we can store the UnitType and Unit as integers in our Entities. Then we can use UnitType and Unit to convert to UnitInfo in this Library and subsequently have a function that takes UnitType, Unit and Magnitude as parameters to return IQuantity. I feel like that's somehow too convoluted and a lot of code. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I can imagine a few ways of using this to persist data. Specifically Entities using EntityFramework. I was wondering what the best and most recommended practice for creating Entities using this library. For example lets say I have a "InventoryItem" entity with a BaseUnitInfo property and let's say I have RecievingItem Entity with an IQuantity that needs to be saved to the database. I was hoping someone could give me any tips or anything that a new user of this library would miss when starting to tackle such problems.
Thanks in advance,
Shaamil.
Beta Was this translation helpful? Give feedback.
All reactions