I think this ticket may have pointed me in the right direction: https://support.aspnetzero.com/QA/Questions/10593/Access-of-multi-tenant-transaction-data
In effect, disable the tenant filter?
This maybe the best approach for empowering host to work with tenant specific entities across the board.
Testing -
Version 11.01, MVC, .net Core
Using the method listed here:
https://docs.aspnetzero.com/en/aspnet-core-angular/latest/Core-Angular-Sign-In-Without-Specifying-Tenant
How do I move a user from one tenant to another, as the host?
Since the user is associated with the Tenant, when logged in as host, the framework doesn't return these users.
My scenario is where a tenant will have users who have specific data associated with them, not the tenant. They may be a customer of tenant A, but then move to tenant B.
The associated data would move with the user, of course.
How would I approach creating a tool for the host to search and work with all user accounts across all tenants? IRepository seems to block this?
Do you have an example of manually adding the relation to a Tenant I could look at?
Do I just put the nullable TenantId on the model, then modify the getall to include the current TenantId to ensure each tenant is only returned associated entities?
Thanks
ok - Ill experiment with that.
thank you
Rather than put the entity at the tenant level, we want to edit a tenants departments at the host level.
If I use the radtool - the Tenant isn't available as a navigation property.
We would like to search across tenants and all departments for a specific department sometimes, whie logged in as host.
In addition, we don't want the tenant being able to add or remove departments.
Would it be better to add this to the tenant and host, then define a role for the tenant so they have no access to departments?
Not sure of the best approach. Any advice is appreciated.
Everything seems to be testing ok - closing.
This also worked with MySql 8.
Update - I've also tried mySql 5.7, still doesn't work with native. Something to do with mapping.
I tried the Pomelo nuget package, and after some work - I was able to determine that the instructions for the context configurer are out of date.
Found the answer here: https://gitanswer.com/efcore-pomelo-5-0-error-a-relational-store-has-been-configured-without-specifying-either-the-dbconnection-or-connection-string-to-use-csharp-pomelo-entityframeworkcore-mysql-743662271
This worked. I updated all connection strings - and modified my configurer
using System.Data.Common;
using System.Diagnostics;
using Microsoft.EntityFrameworkCore;
namespace YourProjectName.EntityFrameworkCore
{
public static class YourProjectNameDbContextConfigurer
{
public static void Configure(DbContextOptionsBuilder<YourProjectNameDbContext> builder, string connectionString)
{
builder.UseMySql(connectionString, ServerVersion.AutoDetect(connectionString));
}
public static void Configure(DbContextOptionsBuilder<YourProjectNameDbContext> builder, DbConnection connection)
{
builder.UseMySql(connection.ConnectionString, ServerVersion.AutoDetect(connection.ConnectionString));
}
}
}
I'm going to continue testing.
I'll close this one and comment on other thread.
Thank you.
has anyone tried this?
abp docs arent correct either.
ive been unable to get it to work.