using (_session.Use(desiredTenant.Id, desiredUser.Id)) { //await CreateNewCorrectiveMaintenanceRequest(inputInternal); var output = inputInternal.MapTo<MaintenanceRequest>(); await _maintenanceRequestManager.CreateNewCorrectiveMaintenanceRequestAsync(output); } I can confirm, that desiredUser.Id has non-null value, but the entity in dababase has CreatorUserId null.
Am I missing something?
If LDAP authentication is used (.NET Core + Angular), are there any difficulties (additional request for password,...) to access files on external network drives (with the same AD credentials which are used for authenticating in ANZ)?
For instance. ANZ-based app would be hosted on application server, but files would be stored/located on multiple different external network drives inside local network. Administrator for files on these network drives would assign which AD user could access specific file.
ANZ-based app should be able gracefully handle file access permission stuff transparent as possible.
Thank you for advices.
MyPeriodicBackgroundMethod()
{
var tenantIdList = new List<int>(); //all **tenants** which have **dedicated database**
foreach (var tenantId in tenantIdList)
{
using (_unitOfWorkManager.Current.SetTenantId(tenantId)
{
//code for specific tenant - inserts, updates, deletes in this tenant database
}
}
}
Is somehow possible and safe make foreach loop parallel (TPL - Parallel.ForEach) or not in such background job or worker? Thank you for explanations.
Let's say that we have the following co-related entities.
DeviceType Device DeviceStatusHistory
Each DeviceType has 0 or more devices (defined with serial numbers). Each device has 0 or more history (status history).
public class DeviceType : AggregatedRoot<int> {
...
public ICollection<Device> { get; set; }
}
public class Device : AggregatedRoot<long> {
...
public ICollection<DeviceSatusHistory> { get; set; }
}
public class DeviceSatusHistory : Entity<long> {
...
}
The main point is that DeviceType is "absolute root", but particular device is also "strong independent entity".
Is semantically correct that Device is also AggregatedRoot or it should be Entity<long>?
Thank you for suggestions.
For instance that one code list is common on application level. Tenant users cannot even change/add/delete values of this code list. Our policy is also that each tenant has to have separated database (and not inside host database). Such code list (SQL table) has IMAYHaveTenant in C# model.
Is something wrong, that Migrator creates code list values in each tenant database, because we want to limit number of SQL queries to host database. This is more important in public cloud environment (Azure,...) so that the costs of these queries are directly "forwarded" to tenant's database.
Can someone confirm that described concept is good or it's better to have such code lists just in host database anyway?
Thank you.
Based on all conversations on GitHub when mixing async and sync code, I would like to know if calling DataSourceLoader.Load in Task is REALLY safe (no thread starvation or other runtime problems possible?
public async Task<object> Get(DataSourceLoadOptions loadOptions)
{
object result = await Task.Run(() => DataSourceLoader.Load(SampleData.Orders, loadOptions));
return result;
}
https://www.devexpress.com/Support/Center/Question/Details/T621512/how-to-use-datasourceloader-in-an-async-controller-action
Thank you for explanations.
In MVC (jQuery) solution is IdentityServer enabled by default: https://docs.aspnetzero.com/documents/aspnet-core-mvc/latest/Infrastructure-Core-Mvc-Identity-Server4-Integration
In Angular documentation, Identity Server 4 is not even mentioned: https://docs.aspnetzero.com/documents/aspnet-core-angular/latest/Infrastructure-Angular
But defferences table shows:
https://docs.aspnetzero.com/documents/common/latest/Version-Differences#version-differences-table
In Angular solution, Identity Server is also diabled by default.
Why such differences between projects?
CreateOrMigrateForTenant(AbpTenantBase tenant, Action<TDbContext> seedAction);
in migrator executer: _migrator.CreateOrMigrateForTenant(tenant, SeedHelperTenantCustom.SeedTenantDb);
public class SeedHelperTenantCustom
{
public static void SeedTenantDb(IIocResolver iocResolver)
{
WithDbContext<ThynkrDemoDbContext>(iocResolver, SeedTenantDb);
}
public static void SeedTenantDb(ThynkrDemoDbContext context)
{
new InitialTenantDbBuilderCustom(context).Create();
}
private static void WithDbContext<TDbContext>(IIocResolver iocResolver, Action<TDbContext> contextAction)
where TDbContext : DbContext
{
using (var uowManager = iocResolver.ResolveAsDisposable<IUnitOfWorkManager>())
{
using (var uow = uowManager.Object.Begin(TransactionScopeOption.Suppress))
{
var context = uowManager.Object.Current.GetDbContext<TDbContext>(MultiTenancySides.Tenant);
contextAction(context);
uow.Complete();
}
}
}
}
How can I obtain tenantId for current tenant context in SeedTenantDb method (action)? Thank you.
Hi,
Based on ABP documentation for Background workers (https://aspnetboilerplate.com/Pages/Documents/Background-Jobs-And-Workers#background-workers), I am wondering how is the most convenient way for running the same worker on all databases (tenant databases)?
I have strictly separated databases for each tenant and none is using a host database.
Thank you for explanations.
One of our customers wants that tenant is automatically selected when a user comes to login page (because all application is "inside" tenant and not host). Users should not be aware of tenant, because they are confused. However, this customer currently does not have any options that we could "solve" this issue by URL tenant resolving ({TENANCY_NAME}).
Is somehow possible, that one tenant is selected by default (for instance "Default" tenant or any other) and if administrator wants to enter in host, he would change this on login page explicitly (write empty string in modal window on login page when changing tenant)?
Thank you.