0

Please or Register to create posts and topics.

Pro - Scaffold an existing database into the DAL

Am looking to use QuickApp Pro as a new version of an application.

When I try to scaffold the existing database, all the files are created in the main project. How do I do this so the files are created in the DAL project?

This line under startup.cs sets the migration assembly:

options.UseSqlServer(Configuration["ConnectionStrings:DefaultConnection"], b => b.MigrationsAssembly("QuickApp.Pro")));

Change it to "DAL" or your preferred assembly.

You'll need to change it in DesignTimeDbContextFactory.cs too.

For more information on this topic please see this link: https://docs.microsoft.com/en-us/ef/core/managing-schemas/migrations/projects

KeithSinclair has reacted to this post.
KeithSinclair

Yes, that does the trick.

Many thanks for the quick response

Deleted user has reacted to this post.
Deleted user