1

I am a little bit confused about this question.

There is a project that people can register. But when a user register, project will create a new database and tables for this user. And I don't know how to use this with entity framework core.

Normally I use appsettings.json to use default connection string and identity connection string.

In this question, I wanna know how to use dynamic connection strings in entity framework core, which is created for specific users.

Normally DbContext services are added at Program.cs or Startup.cs (Before .NET 6.0) Like;

builder.Services.AddDbContext<DbContextName>(options => 
   options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection"), b => 
   b.MigrationsAssembly("ProjectName")));

Does anyone have an idea to use this with dynamic connection strings... or is there another way that I should follow.

Thanks in advance...

serhatyt
  • 180
  • 2
  • 14

0 Answers0