3 Answer(s)
-
0
Hi, The problem before I wrote that Default Tenancy Code Name not change. When I add that code in the Tenant.cs file
public new const string DefaultTenantName = "NewDefaultTenantName";
My process, Add related code in Tenan.cs (.Core/MultiTenancy/Tenant.cs) *Update-Database (First Time) *Login as Admin *Then Default Tenant comes again.
By the way, my project ASP.NET Core + Jquery
Thanks.
-
1
use MultiTenancy.Tenant.DefaultTenantName is work for me.
public class Tenant : AbpTenant<User> { //Can add application specific tenant properties here public new const string DefaultTenantName = "NewDefaultTenantName"; //..... }
private void CreateDefaultTenant() { //Default tenant var defaultTenant = _context.Tenants.IgnoreQueryFilters().FirstOrDefault(t => t.TenancyName == MultiTenancy.Tenant.DefaultTenantName); if (defaultTenant == null) { defaultTenant = new MultiTenancy.Tenant(MultiTenancy.Tenant.DefaultTenantName, MultiTenancy.Tenant.DefaultTenantName); var defaultEdition = _context.Editions.IgnoreQueryFilters().FirstOrDefault(e => e.Name == EditionManager.DefaultEditionName); if (defaultEdition != null) { defaultTenant.EditionId = defaultEdition.Id; } _context.Tenants.Add(defaultTenant); _context.SaveChanges(); } }