What is your:
Have you added both DbContexts like in this comment: https://github.com/aspnetzero/aspnet-zero-core/issues/372#issuecomment-327497309
Add this namespace:
using Abp.Configuration.Startup;
Switch to DbContext transaction API in PreInitialize method of YourEntityFrameworkModule:
Configuration.ReplaceService<IEfCoreTransactionStrategy, DbContextEfCoreTransactionStrategy>(DependencyLifeStyle.Transient);
It is a collection navigation property. Use EnsureCollectionLoadedAsync.
You definitely should not do that, as CreatorUserId is handled by ABP. You can implement and manage your own CreatorUserName property.
Your solution is not good because i have to get all data from model A first.
What do you mean? That's what your code does.
Do you have other solution to implement join entities on multiple dbcontext?
Maybe you can use a stored procedure and a linked server, but I can't help with that.
DbContextEfTransactionStrategy simply uses the same transaction for multiple DbContexts. You can't join entities from multiple DbContexts.
For that specific query, you can do this:
var bModelCodes = _modelB.GetAll().Select(b => b.modelCode).ToList();
var aModels = _modelA.GetAll().Where(a => bModelCodes.Contains(a.modelCode)).ToList();
You need to login with your GitHub account to access the private repo. You can invite yourself here: <a class="postlink" href="https://aspnetzero.com/LicenseManagement">https://aspnetzero.com/LicenseManagement</a>
It's in the link. Reproduced here:
configure it in PreInitialize method of YourProjectNameDataModule like that:
Configuration.ReplaceService<IEfTransactionStrategy, DbContextEfTransactionStrategy>(DependencyLifeStyle.Transient);