You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In many scenarios it's OK. However, there are scenarios where we want to have a model definition and mapping it to a database separate. For example, if you want to have entities in domain layer and mapping in infrastructure layer.
Design
The proposal is based on how it is in EF. Have a configuration class where, we are fluent define model mapping to database.
Starting discussion about Use different kind of configuration than attributes from #8.
Current state
Now some configuration is allowed only using attributes (
Key
,Alias
). Something can be changed using customModelMapper
.Available attributes:
Alias
- Define name for database object (table, column).Key
- Define primary key for table.NoMap
- When property is mark with this attribute, thenKORM
ignore this column.Converter
- Define converter for converting values between database and CLR.When want use property injection, we must use
ModelMapper
:In many scenarios it's OK. However, there are scenarios where we want to have a model definition and mapping it to a database separate. For example, if you want to have entities in domain layer and mapping in infrastructure layer.
Design
The proposal is based on how it is in EF. Have a configuration class where, we are fluent define model mapping to database.
Uses in ASP.NET Core applications:
Implementation
I tried to explore it.
It is possible implemented into KORM.
The text was updated successfully, but these errors were encountered: