Seed data for tenant database
See original GitHub issueI create a class name InitialBillingGuideLineCreator
to seed data to tenant database. I call it in DefaultTenantBuilder
like this
public void Create()
{
CreateDefaultTenant();
// Seed BillingGuideLine
new InitialBillingGuideLineCreator(_context).Create();
}
But it only seed data to host database. Please give me instruction how to seed to tenant’s database.
Thank for your support.
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Tenant migrations & seeds
How to run migrations for specific or all tenants. ... The same way works for seeding only in the tenant Id 1 website....
Read more >How to seed data for Tenant when it is created for the first ...
Hi, I'm trying to seed data in the TenantAppService.Create method. The IAbpZeroDbMigrator interface do not provide the expected method:.
Read more >Data Seeding | Documentation Center | ABP.IO
It is typical to check database if the seeding data is already present. ... this value while inserting data or performing custom logic...
Read more >Migrations and seeds - Tenancy
Run migrations after a database is created; Run seeds after the database is created ... you might want to seed the database with...
Read more >How do you seed data? : r/dotnet
Database seeding is populating a database with an initial set of data. It's common to load seed data such as initial user accounts...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You shouldn’t inject
DbContext
intoTenantAppService
.As @acjh pointed out, you can insert
InitialBillingGuideLineCreator()
inTenantAppService.cs
e.g.
Yes, you can also follow such a way. You can seed after this line https://github.com/aspnetboilerplate/module-zero-core-template/blob/master/aspnet-core/src/AbpCompanyName.AbpProjectName.Migrator/MultiTenantMigrateExecuter.cs#L90