Class TenantManager
Manager for tenants
Inheritance
Inherited Members
Namespace: Simplic.Framework.Core
Assembly: Simplic.Framework.Base.dll
Syntax
public sealed class TenantManager
Properties
| Improve this Doc View SourceSingleton
Singleton access
Declaration
public static TenantManager Singleton { get; }
Property Value
Type | Description |
---|---|
TenantManager |
Methods
| Improve this Doc View SourceDelete(Tenant)
Delete tenant from database
Declaration
public void Delete(Tenant tenant)
Parameters
Type | Name | Description |
---|---|---|
Tenant | tenant | Tenant |
DeleteOrganization(Guid)
Delete an organizaion tenant by its id
Declaration
public void DeleteOrganization(Guid id)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | id | Unique tenant id |
Get(Guid)
Get instance of a tenant
Declaration
public Tenant Get(Guid id)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | id | Unique id of the tenant |
Returns
Type | Description |
---|---|
Tenant | Null if no instance found, else instance |
Get(String)
Get instance of a tenant
Declaration
public Tenant Get(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Intern name of the tenant |
Returns
Type | Description |
---|---|
Tenant | Null if no instance found, else instance |
GetAll()
Get all tenant instances
Declaration
public IEnumerable<Tenant> GetAll()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<Tenant> | Null if no instance found, else all instances |
GetAllActiveOrganizations()
Gets all active organizations from the database
Declaration
[Obsolete("Use organization service instead.")]
public IEnumerable<OrganizationTenant> GetAllActiveOrganizations()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<OrganizationTenant> | Enumerable of organization tenants |
GetAllOrganizations()
Gets all organizations from the database
Declaration
[Obsolete("Use organizaiton service instead.")]
public IEnumerable<OrganizationTenant> GetAllOrganizations()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<OrganizationTenant> | Enumerable of organization tenants |
GetAllOrganizationsIgnoreSession()
Gets all organizations from the database
Declaration
[Obsolete("Use organizaiton service instead.")]
public IEnumerable<OrganizationTenant> GetAllOrganizationsIgnoreSession()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<OrganizationTenant> | Enumerable of organization tenants |
GetByUser(Int32, Boolean)
Get all tenants where the given user is part of
Declaration
public IEnumerable<OrganizationTenant> GetByUser(int userId, bool onlyActiveTenants = true)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | userId | Unique user id |
System.Boolean | onlyActiveTenants | If set to true, only active tenants will be queried |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<OrganizationTenant> | Enumerable of tenants |
GetConnectedTenants(Guid)
Get all system/technical tenants that are connect with the organization tenant
Declaration
public IEnumerable<Tenant> GetConnectedTenants(Guid organizationTenantId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | organizationTenantId | Unique tentant id |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<Tenant> | Enumerable of tenants |
GetOrganization(Guid)
Get a organization tenant from the database
Declaration
public OrganizationTenant GetOrganization(Guid id)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | id | Unique tenant id |
Returns
Type | Description |
---|---|
OrganizationTenant | Tenant instance |
GetSubOrganizations(Guid)
Get all sub organizations
Declaration
public IEnumerable<OrganizationTenant> GetSubOrganizations(Guid organizationTenantId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | organizationTenantId | Unique tentant id |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<OrganizationTenant> | Enumerable of tenants |
GetTenantSystemType(Guid)
Get a tenant system type by its id
Declaration
public TenantSystemType GetTenantSystemType(Guid id)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | id | Id of the tenant system |
Returns
Type | Description |
---|---|
TenantSystemType | Instance of the system if found, else null |
Save(Tenant)
Save tenant to the database
Declaration
public void Save(Tenant tenant)
Parameters
Type | Name | Description |
---|---|---|
Tenant | tenant |
SaveOrganization(OrganizationTenant)
Save the organization tenant in database
Declaration
public void SaveOrganization(OrganizationTenant tenant)
Parameters
Type | Name | Description |
---|---|---|
OrganizationTenant | tenant | tenant instance |