Update entity class in ASP.NET Core Entity Framework

前端 未结 2 1746
逝去的感伤
逝去的感伤 2021-02-05 03:34

I have created the model from existing database using Entity Framework in ASP.NET Core.

Here is the model of the Market table

public parti         


        
2条回答
  •  你的背包
    2021-02-05 04:02

    One option is-

    You can use Scaffold-DbContext command with -force flag. This way you can force scaffolding to overwrite existing model files.

    sample command -

    Scaffold-DbContext "" Microsoft.EntityFrameworkCore.SqlServer -t  -f
    

    Replace ConnectionString & TableName as per your requirements.

提交回复
热议问题