Would you (or do you) use Option to model nullable database columns?
#1102
-
|
I'm designing some database models for a new project and was wondering if anyone uses I can see the benefit of having If you do use Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
You have answered the question by yourself. EF Core and other ORM`s are intended to work with raw C# features, so there is no point trying to tie EF Core and high-level functional (unknown for him) things. In other words, let the So, how to connect your To summarize, my best advice is even beyond using Hope that I answered your question! |
Beta Was this translation helpful? Give feedback.
-
|
@Meigs2 - I think you might also want to check out the discussion here - issue |
Beta Was this translation helpful? Give feedback.
You have answered the question by yourself. EF Core and other ORM`s are intended to work with raw C# features, so there is no point trying to tie EF Core and high-level functional (unknown for him) things.
In other words, let the
Optionbe inside yourDomain, while nullable reference types remain insideInfrastructure(ORMs and so forth). Don't mix them (useOptioninsideInfrastructureand vice versa), it is a guaranteed way for a lot of mistakes.So, how to connect your
DomainandI…