Open Closed

Loading Sample Data into the application #11258

moonch created


  • What is your product version? Latest
  • What is your product type (Angular or MVC)? MVC
  • What is product framework type (.net framework or .net core)? .NET6

Dear Customer Support. I am developing a multi-tenant application with one shared database. What I would like to achieve is for all new tenants once they create an account they can view SAMPLE data inside the application, this will help them better evaluate the product instead of looking at pages blank of any data. To achieve this I can think of some scenarios. 1- Load Data dummy data created in View Models. Pros • Tie it to the edition, so if the edition is free, this dummy data is visible, if not free then not visible. • No need to seed data into the database. Cons • CRUD operations cannot be performed. Adding, Deleting, or editing items is not possible. This will break the code, Items have no Ids.

2- Seed Sample Data for each Tenant on Tenant creation. Pros • Allows tenants complete control over sample data that holds their unique tenant Id. Cons • Duplicated data on one database.

3- Sample Data is available to the Default Tenant. And loaded to every other tenant by Switching Between default and Tenant Pros • Sample Data is available only once. • CRUD operations are possible but require code adjustment to switch between Cons • Changes to data by one tenant are then visible to all other tenants.

The Ideal scenario

  • Any Tenant can view sample data and play with it whether by adding or editing any of its items. Changes are visible to tenants momentarily.
  • If the tenant logs out, and logs again the original version of the sample data reappears. The need to save changes permanently is not necessary.
  • This data is included once in the shared database.

Any Ideas on the above, some features in ABP that could facilitate achieving the desired outcome, or any examples your customers performed to achieve a similar outcome? Any help is appreciated. Thanks.

1 Answer(s)