I have an entity below that, when I create, inserts with TenantId
null
. Is it necessary to use CurrentTenant.Id
to set TenantId
manually?
public class Hall : AuditedAggregateRoot<Guid>, IMultiTenant
{
public string Name { get; set; }
public string Location { get; set; }
public string Explanation { get; set; }
public Guid? TenantId { get; set; }
}
If you don't inherit from
AsyncCrudAppService
, then it is necessary to setTenantId
yourself.ABP Framework (abp.io) does not limit the case where you may want to create a host or other tenant entity within a tenant scope.
References: