Open Closed

How to set extended property of saas tenants, while creating a new tenant #7153


User avatar
0
Sergei.Gorlovetsky created

Hello,

I have used this method (https://docs.abp.io/en/abp/latest/Object-Extensions#object-extension-manager) to extend Saas.Tenants

I have BlobConnectionString as new column in Saas.Tenants Table. I am wondering, how can I add that extra property in the API call while creating a new tenant ?

I tried to add that under extraproperties in the JSON body, but that did not help.

End point : /api/saas/tenants

{
    "extraProperties": {
        "blobConnectionString" : "abc"
    },
    "name": "tenant7",
    "editionId": null,
    "adminEmailAddress": "tenant3@mellowoodmedical.com",
    "adminPassword": "Test@123",
    "activationState": 0,
    "activationEndDate": "",
    "connectionStrings": {
        "id": "",
        "default": null,
        "databases": []
    }
}

1 Answer(s)
  • User Avatar
    1
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    First, you need to configure the module entity extension.

    https://docs.abp.io/en/abp/latest/Module-Entity-Extensions#quick-example

    For example:

    public static void ConfigureExtraProperties()
    {
        OneTimeRunner.Run(() =>
        {
            ObjectExtensionManager.Instance.Modules()
                .ConfigureSaas(saas =>
                {
                    saas.ConfigureTenant(tenant =>
                    {
                        user.AddOrUpdateProperty<string>( //property type: string
                            "BlobConnectionString", //property name
                            property =>
                            {
                                //...other configurations for this property
                            }
                        );
                    });
                });
        });
    }
    
Made with ❤️ on ABP v9.1.0-preview. Updated on December 13, 2024, 06:09