Hi, I am trying to delete an existing Default Tenant and recreate databases with another tenant name which will have dedicated database for it. That works fine,but my unit test cases are always pointing to Default tenant and now they are failing. What is the right way to create a new Tenant instead of Default one after Host creation.Also unit test cases should be pointing to that tenant. Any help will be appreciated.
8 Answer(s)
-
0
hi,
If you want to change the name "Default" for the default tenancy name.
- TenantConsts > DefaultTenantName = "MyDefault"
- AbpTenantBase > DefaultTenantName = "MyDefault"
- UserLinkAppService_Tests > LinkToUser() > TenancyName = "MyDefault"
-
0
<cite>alper: </cite> hi,
If you want to change the name "Default" for the default tenancy name.
- TenantConsts > DefaultTenantName = "MyDefault"
- AbpTenantBase > DefaultTenantName = "MyDefault"
- UserLinkAppService_Tests > LinkToUser() > TenancyName = "MyDefault"
we can't change the DefaultTenantName in AbpTenantBase as it is metadata file.How to do that?
-
0
yes, you're right. it's a const. did you try to run the tests without that change?
-
0
<cite>alper: </cite> yes, you're right. it's a const. did you try to run the tests without that change?
Not yet.Because of that AbpTenantBase.DefaultTenantName can't be changed from metadata,when I try to use seed method the default tenant gets created which I don't want to.I want to create a tenant with another name.Is it possible to do that?
-
0
Can you open an issue on GitHub to make it changeable? <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/issues/new">https://github.com/aspnetboilerplate/as ... issues/new</a>
-
0
<cite>alper: </cite> Can you open an issue on GitHub to make it changeable? <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/issues/new">https://github.com/aspnetboilerplate/as ... issues/new</a>
Ok,I will create an issue for it. Thanks
-
0
Hi,
Did you create a issue? I didn't find it :(
How did you solve this problem?
Thanks in advice,
-
0
@registosglintt since it is a const in ABP Framework, you can't change it. But you can create different tenant of course.