Check the docs before asking a question: https://abp.io/docs/latest
Check the samples to see the basic tasks: https://abp.io/docs/latest/samples
The exact solution to your question may have been answered before, and please first use the search on the homepage.
Provide us with the following info:
🧐 Hint: If you are using the ABP Studio, you can see all the information about your solution from the configuration window, which opens when you right-click on the solution and click on the Solution Configuration
button.
Background: I have a following a modular monolith style of developing an application. I have 2 modules apart from Main app.
I am trying to hide the linked accounts, sessions, account delegation etc. Followed the instructions here but did not work. See my screenshots https://abp.io/support/questions/3741/Linked-accounts-in-header-bar
But when i navigate to **session **page - it is not there which is good. Question: Why does it show up when I navigate to other pages + How i can switch it off on all pages?
Question : **How to do the same customization? in the BLAZOR new web app. **
See the code below for CustomRegisterModel How should i modify to set the DEFAULT NAME as** Input.UserName** `
public override async Task<IActionResult> OnPostAsync()
{
try
{
var tenantName = $"{Input.UserName}-dedicated-tenant";
var defaultConnectionString = _configuration.GetConnectionString("Default");
if (string.IsNullOrEmpty(defaultConnectionString))
{
throw new Exception("Default connection string is not configured in app settings.");
}
// Create the database for the new tenant
var tenantConnectionString = CreateTenantSpecificConnectionString(defaultConnectionString, tenantName);
//await CreateTenantDatabaseAsync(tenantConnectionString, tenantName);
SaasTenantDto tenant;
using (var uow = _unitOfWorkManager.Begin(requiresNew: true, isTransactional: true))
{
var tenantCreateDto = new SaasTenantCreateDto
{
Name = tenantName,
AdminEmailAddress = Input.EmailAddress,
AdminPassword = Input.Password,
ConnectionStrings = new SaasTenantConnectionStringsDto
{
Default = tenantConnectionString
}
};
tenant = await _tenantAppService.CreateAsync(tenantCreateDto);
// Migrate and seed the tenant database
await MigrateAndSeedTenantDatabaseAsync(tenant.Id);
await uow.CompleteAsync();
}
return RedirectToPage("/Login"); // or wherever you want to redirect after successful registration
}
catch (Exception ex)
{
_logger.LogError(ex, "An error occurred during registration");
// Redirect to the login page
return RedirectToPage("./Login");
}
}
private string CreateTenantSpecificConnectionString(string defaultConnectionString, string tenantName)
{
var builder = new NpgsqlConnectionStringBuilder(defaultConnectionString);
builder.Database = tenantName;
return builder.ConnectionString;
}
private async Task MigrateAndSeedTenantDatabaseAsync(Guid tenantId)
{
using (_currentTenant.Change(tenantId))
{
await _dbSchemaMigrator.MigrateAsync();
}
}
}
`