Angualr + aspnet core V12.
Hi,
my users whant to set userspecific start page when login - is it possible / how?
Thanks Oliver
Hi,
I pass tenantId from UI to API - the value of tenantId is correct - then I try to set using (CurrentUnitOfWork.SetTenantId(tenantId))
and request for a setting the value: var partnerNameFromDB = await SettingManager.GetSettingValueForTenantAsync(AppSettings.SAMLLoginManagement.PartnerName, AbpSession.GetTenantId());
But what I get as result is the setting from host (where TenandId in database is NULL)
Any idea - here my code:
[HttpGet] public async Task<IActionResult> InitiateMySingleSignOn(string returnUrl, int tenantId) { Logger.Info("returnUrl" + returnUrl + " - tenantId" + tenantId.ToString());
using (CurrentUnitOfWork.SetTenantId(tenantId))
{
try
{
var partnerNameFromDB = await SettingManager.GetSettingValueForTenantAsync(AppSettings.SAMLLoginManagement.PartnerName, AbpSession.GetTenantId());
Thanks
I want to show a notification ... thx
Usage: Angular + .NET core ASPZERO version 12x:
I needs to send messages to specific user of a specific tenant from console app. How could that work? below some proposal fromChatGTP
using Microsoft.AspNetCore.SignalR.Client; using System; using System.Threading.Tasks;
class Program { static async Task Main(string[] args) { // Configuration var apiUrl = "http://your-api-url"; var hubPath = "/yourHubPath"; var accessToken = "your-access-token"; // Obtain from your authentication mechanism
var hubConnection = new HubConnectionBuilder()
.WithUrl($"{apiUrl}{hubPath}", options =>
{
options.AccessTokenProvider = () => Task.FromResult(accessToken);
})
.Build();
// Handle connection events
hubConnection.Closed += async (error) =>
{
Console.WriteLine($"Connection closed. Reconnecting...");
await Task.Delay(new Random().Next(0, 5) * 1000);
await hubConnection.StartAsync();
};
// Start the connection
await hubConnection.StartAsync();
Console.WriteLine($"Connection started with connection ID: {hubConnection.ConnectionId}");
// Send a message to a specific user
await SendMessageToUser(hubConnection, "userId123", "Hello to specific user!");
// Close the connection when done
await hubConnection.StopAsync();
Console.WriteLine("Connection stopped.");
}
static async Task SendMessageToUser(HubConnection hubConnection, string userId, string message)
{
try
{
await hubConnection.InvokeAsync("SendMessageToUser", userId, message);
Console.WriteLine($"Message sent to user {userId}: {message}");
}
catch (Exception ex)
{
Console.WriteLine($"Error sending message: {ex.Message}");
}
}
}
Hi,
Version used: Angular & ASPNET core V12.1
I needs to setup (without using the appsettings.json) a scenario, that tenant is automatilly selected on login page based on subdomain in multi-tenant setup from incoming URL
Example https://tenant1.myURL.com -> tenant1 is selected on the login page
https://tenant2.myURL.com -> tenant2 is selected on the login page .........
How could that work?
thanks!
Hi,
I integrated costom .net Framework 4.8 project into *.Core.Shared - in my Framework 4.8 project I've multiple connection strings
To get it up and running - I needa to have these multiple connection strings in HOST project.
Could it be done like this?
json
"ConnectionStrings": { "DefaultConnection": "YourDefaultConnectionStringHere", "Database1Connection": "YourDatabase1ConnectionStringHere", "Database2Connection": "YourDatabase2ConnectionStringHere" }
Update ConfigureServices: Modify your ConfigureServices method to include the configuration for multiple connection strings. Below is an example of how you can do this:
csharp
public IServiceProvider ConfigureServices(IServiceCollection services) { // ... Existing code ...
// Register connection strings
services.AddDbContext<ApplicationDbContext>(options =>
options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
services.AddDbContext<Database1Context>(options =>
options.UseSqlServer(Configuration.GetConnectionString("Database1Connection")));
services.AddDbContext<Database2Context>(options =>
options.UseSqlServer(Configuration.GetConnectionString("Database2Connection")));
// ... Existing code ...
}
In this example, I assumed that you're using Entity Framework Core for database access, and I've added ApplicationDbContext, Database1Context, and Database2Context as placeholders for your actual database contexts.
Using Connection Strings: Now you can inject these database contexts into your services or controllers and use them as needed. For example:
csharp
public class SomeService
{
private readonly ApplicationDbContext _dbContext;
private readonly Database1Context _db1Context;
private readonly Database2Context _db2Context;
public SomeService(ApplicationDbContext dbContext, Database1Context db1Context, Database2Context db2Context)
{
_dbContext = dbContext;
_db1Context = db1Context;
_db2Context = db2Context;
}
public void SomeMethod()
{
// Use _dbContext, _db1Context, and _db2Context here
}
}
By following these steps, you can use multiple connection strings in your ASP.NET Core application. Remember to replace placeholders like "YourDefaultConnectionStringHere", "YourDatabase1ConnectionStringHere", and "YourDatabase2ConnectionStringHere" with your actual connection strings. Additionally, make sure to adjust the context classes and database access code according to your application's architecture.
Hi,
we use Angular + net core - is it possible, additional to confirm a user account with mail, to add account confimation also with mobile phone and SMS possible? We build on top a native mobile app and want to add account confimation via mobile phone.
Thanks Oliver
no there is no Mobile profile..
also Host app with start-host-mobile.bat is not working
Hi, when I try to start MAUI mobile app -v12.1 - I get below error - how to get it up and running?
Web.Host>dotnet run --launch-profile Mobile The launch profile "Mobile" could not be applied. There is no launch profile with the name "Mobile" available.
thanks
I've the same problem - any solution?