Entity Framework Core Customize Scaffolding

前端 未结 5 1661
天命终不由人
天命终不由人 2020-12-10 14:19

I have done scaffolding of my SQLServer database. And it creates the POCO objects in the specified folder. What i would like to do is that it extends from my base class. I a

5条回答
  •  無奈伤痛
    2020-12-10 14:49

    Currently, the scaffolding tools do not support the scenario you describe. There are no options to customise their output, only the location of the generated files and whether to use Fluent API or data annotations for configuration.

    EF Core is a Code First framework. The advice is that once you have reverse-engineered your model from the existing database, you use migrations to keep the two in sync with each other from then on.

    Having said that, I realise that might not always be possible depending on how responsibilities are apportioned within teams. In that kind of case, you might want to consider opening an issue requesting this feature on the GitHub repo for EF Core: https://github.com/aspnet/EntityFramework.

提交回复
热议问题