Sqlite Entityframework
Hi, what's the best choice here ? should i create my user with all the options in the same models for the database and use a DTO to wrap all the option in 1 class like UserOption here ? because there in my code Entity framework say that i need to declare an id for UserOption but it seem useless to go in this kind of structure in this context to me
1 Reply
I would put all the directly user-related properties in the
User
model. If you'll have many options per user, or more complex data structures, you can serialize the UserOptions
class as json/xml in the database. But if you do this, keep in mind that you won't be able to easily query user options directly (e.g. select all users with EN language).