Open Closed

How do I seed a Demo tenant #5699


User avatar
0
phil@travelengine.com.au created
  • ABP Framework version: v7.3.2
  • UI Type: Blazor Server
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): no
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

I am trying to create some extensive data seeding for a Demo tenant when I run the DbMigrator.

I am having a number of challenges.

First, there seems to be no way to control the ordering of different IDataSeedContributors so it is not possible to ensure that dependent objects are seeded in the right order.

Second, even if I can accidentally get the IDataSeedContributors to seed in the correct order, there appears to be no reliable way to retrieve rows that have previously been seeded. This appears to be because the entire data seeding process is performed in a single transaction and it is not possible to query the database and find rows that were already created, because they have not yet been committed.

Are there any examples or blog posts showing how to perform anything but the simplest of data seeding?


1 Answer(s)
  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hi

    You can check this file as example OpenIddictDataSeedContributor.cs it is seeding the openiddict clients. to have multiple transaction you can check this doc related to Unit of work https://docs.abp.io/en/abp/latest/Unit-Of-Work#begin-a-new-unit-of-work

    https://docs.abp.io/en/abp/latest/Data-Seeding

Made with ❤️ on ABP v9.1.0-preview. Updated on November 01, 2024, 05:35