Home > Net >  The OnModelCreating EFCore smoke how to implement each entity class
The OnModelCreating EFCore smoke how to implement each entity class

Time:10-11

Unused EF for many years, recently early adopters in EFCore 3.1 began to pick up,
Poking fun at the EF Code mode to write when the OnModelCreating table more field is written to acid, seriously slow down the development efficiency,,,
Behind simply Sql Server design good after each table and field, and then through the scaffold - dbcontext reverse generated code manual sorting again,,,,
(helpless ah, I know this approach to reverse-engineer has lost the meaning of EF CodeFirst)

ok, question:
Table or field most of the time, will find that the DbContext
OnModelCreating write entity attribute description will appear inside the code is very long and seems particularly uncomfortable
Impression EF6 era, can describe smoking inside the table from the OnModelCreating entity writes each Model entity class,
And then the corresponding Model inherit a what, and then defined in the entity class can,,,
Helpless old age, poor memory, many years did not use EF forgot, consult the people how to deal with it?

CodePudding user response:

It is as you say, the Model First or Code First
  • Related