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
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.
Of note, I also have a 5.6 MySql instance I've tried this with. I'm getting the same error.
I had this same issue - so I entered same namespace but picked .NET 6.0 and downloaded - and I got a .net 6 download with updated files.
I think I closed this by mistake.
I knew this change was coming and I told them the license included changing the namespace once for up to a year.
I downloaded the upgrade incorrectly!
Please help!