How to seed data for Tenant when it is created for the first time?
See original GitHub issueHi, I’m trying to seed data in the TenantAppService.Create method. The IAbpZeroDbMigrator interface do not provide the expected method:
void CreateOrMigrateForTenant(AbpTenantBase tenant, Action<TDbContext> seedAction);
Is there any other way?
Abp version: 3.6.2 ASP Core
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
EF Core Seed Tenant Data #3591
You can modify SeedHelper to insert tenant data. You first need to get list of tenants and then execute same actions for each...
Read more >How do you seed data? : r/dotnet
First the Seed data gets inserted into Temp Tables and then the Temp Tables are synched with the target tables via Sql Merge...
Read more >Applying Seed Data To The Database
One way to seed data in EF Core is by using the DbContext. Database. EnsureCreated() method in your DbContext class. This method will...
Read more >Is there a way to create database and seed data in asp.net ...
First you need to have some kind of identifier that tells you what tenant is accessing the endpoints and what type of database...
Read more >Use Code First Migrations to Seed the Database
In this section, you will use Code First Migrations in EF to seed the database with test data. From the Tools menu, select...
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 can share code. For example TenantRoleAndUserBuilder here https://github.com/aspnetboilerplate/module-zero-core-template/blob/master/aspnet-core/src/AbpCompanyName.AbpProjectName.EntityFrameworkCore/EntityFrameworkCore/Seed/SeedHelper.cs#L29 can be used.
Thank you for your help