Base solution for your next web application
Open Closed

Tenant creation before login #2049


User avatar
0
sison created

Hi,

Can i create new tenant before login, like creates tenant on signup? i tried with new build of boiler plate application. but it shows "Object reference not set to an instance of object" at the point where the tenant been created.

_abpZeroDbMigrator.CreateOrMigrateForTenant(tenant);

how could i solve this issue? i need to create new tenant even before a user login to the application.


3 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    If you want to create a tenant, you can use TenantManager. If you want to create a tenant with a seperate database,

    _abpZeroDbMigrator.CreateOrMigrateForTenant(tenant);
    

    this line does that for you.

    Also there must be a detailed error message in Logs.txt file under your web project. Can you send the detailed error message if you can find it.

    Thanks.

  • User Avatar
    0
    asrar created

    HI,

    This is assuming that a DB exists. Can we create the DB for the tenant, if it doesn't exist, when we create the tenant through the interface?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Can you share your code for creating tenant ? Maybe we can help you better in that way.

    Thanks.