Scaffold-DbContext Use the Force flag to overwrite these files

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

Scaffold-DbContext "<ConnectionString>" Microsoft.EntityFrameworkCore.SqlServer -t <tablename> -f
Replace ConnectionString & TableName as per your requirements.

Add Comment