Show / Hide Table of Contents

Class OrganizationUnit

Represents an organization unit (OU).

Inheritance
System.Object
Entity
Entity<Guid>
BasicAggregateRoot<Guid>
AggregateRoot<Guid>
CreationAuditedAggregateRoot<Guid>
AuditedAggregateRoot<Guid>
FullAuditedAggregateRoot<Guid>
OrganizationUnit
Implements
IAggregateRoot<Guid>
IEntity<Guid>
IAggregateRoot
IEntity
IGeneratesDomainEvents
IHasExtraProperties
IHasConcurrencyStamp
ICreationAuditedObject
IAuditedObject
IFullAuditedObject
IMultiTenant
Inherited Members
FullAuditedAggregateRoot<Guid>.IsDeleted
FullAuditedAggregateRoot<Guid>.DeleterId
FullAuditedAggregateRoot<Guid>.DeletionTime
AuditedAggregateRoot<Guid>.LastModificationTime
AuditedAggregateRoot<Guid>.LastModifierId
CreationAuditedAggregateRoot<Guid>.CreationTime
CreationAuditedAggregateRoot<Guid>.CreatorId
AggregateRoot<Guid>.ExtraProperties
AggregateRoot<Guid>.ConcurrencyStamp
AggregateRoot<Guid>.Validate(ValidationContext)
BasicAggregateRoot<Guid>.GetLocalEvents()
BasicAggregateRoot<Guid>.GetDistributedEvents()
BasicAggregateRoot<Guid>.ClearLocalEvents()
BasicAggregateRoot<Guid>.ClearDistributedEvents()
BasicAggregateRoot<Guid>.AddLocalEvent(Object)
BasicAggregateRoot<Guid>.AddDistributedEvent(Object)
Entity<Guid>.Id
Entity<Guid>.GetKeys()
Entity<Guid>.ToString()
Entity.EntityEquals(IEntity)
Namespace: Volo.Abp.Identity
Assembly: Volo.Abp.Identity.Domain.dll
Syntax
public class OrganizationUnit : FullAuditedAggregateRoot<Guid>, IAggregateRoot<Guid>, IEntity<Guid>, IAggregateRoot, IEntity, IGeneratesDomainEvents, IHasExtraProperties, IHasConcurrencyStamp, ICreationAuditedObject, IAuditedObject, IFullAuditedObject, IMultiTenant

Constructors

OrganizationUnit()

Initializes a new instance of the OrganizationUnit class.

Declaration
public OrganizationUnit()

OrganizationUnit(Guid, String, Nullable<Guid>, Nullable<Guid>)

Initializes a new instance of the OrganizationUnit class.

Declaration
public OrganizationUnit(Guid id, string displayName, Guid? parentId = null, Guid? tenantId = null)
Parameters
Type Name Description
Guid id
System.String displayName

Display name.

System.Nullable<Guid> parentId

Parent's Id or null if OU is a root.

System.Nullable<Guid> tenantId

Tenant's Id or null for host.

Properties

Code

Hierarchical Code of this organization unit. Example: "00001.00042.00005". This is a unique code for a Tenant. It's changeable if OU hierarchy is changed.

Declaration
public virtual string Code { get; }
Property Value
Type Description
System.String

DisplayName

Display name of this role.

Declaration
public virtual string DisplayName { get; set; }
Property Value
Type Description
System.String

ParentId

Parent OrganizationUnit Id. Null, if this OU is a root.

Declaration
public virtual Guid? ParentId { get; }
Property Value
Type Description
System.Nullable<Guid>

Roles

Roles of this OU.

Declaration
public virtual ICollection<OrganizationUnitRole> Roles { get; protected set; }
Property Value
Type Description
ICollection<OrganizationUnitRole>

TenantId

Declaration
public virtual Guid? TenantId { get; protected set; }
Property Value
Type Description
System.Nullable<Guid>

Methods

AddRole(Guid)

Declaration
public virtual void AddRole(Guid roleId)
Parameters
Type Name Description
Guid roleId

AppendCode(String, String)

Appends a child code to a parent code. Example: if parentCode = "00001", childCode = "00042" then returns "00001.00042".

Declaration
public static string AppendCode(string parentCode, string childCode)
Parameters
Type Name Description
System.String parentCode

Parent code. Can be null or empty if parent is a root.

System.String childCode

Child code.

Returns
Type Description
System.String

CalculateNextCode(String)

Calculates next code for given code. Example: if code = "00019.00055.00001" returns "00019.00055.00002".

Declaration
public static string CalculateNextCode(string code)
Parameters
Type Name Description
System.String code

The code.

Returns
Type Description
System.String

CreateCode(Int32[])

Creates code for given numbers. Example: if numbers are 4,2 then returns "00004.00002";

Declaration
public static string CreateCode(params int[] numbers)
Parameters
Type Name Description
System.Int32[] numbers

Numbers

Returns
Type Description
System.String

GetLastUnitCode(String)

Gets the last unit code. Example: if code = "00019.00055.00001" returns "00001".

Declaration
public static string GetLastUnitCode(string code)
Parameters
Type Name Description
System.String code

The code.

Returns
Type Description
System.String

GetParentCode(String)

Gets parent code. Example: if code = "00019.00055.00001" returns "00019.00055".

Declaration
public static string GetParentCode(string code)
Parameters
Type Name Description
System.String code

The code.

Returns
Type Description
System.String

GetRelativeCode(String, String)

Gets relative code to the parent. Example: if code = "00019.00055.00001" and parentCode = "00019" then returns "00055.00001".

Declaration
public static string GetRelativeCode(string code, string parentCode)
Parameters
Type Name Description
System.String code

The code.

System.String parentCode

The parent code.

Returns
Type Description
System.String

IsInRole(Guid)

Declaration
public virtual bool IsInRole(Guid roleId)
Parameters
Type Name Description
Guid roleId
Returns
Type Description
System.Boolean

RemoveRole(Guid)

Declaration
public virtual void RemoveRole(Guid roleId)
Parameters
Type Name Description
Guid roleId

Implements

IAggregateRoot<TKey>
IEntity<TKey>
IAggregateRoot
IEntity
IGeneratesDomainEvents
IHasExtraProperties
IHasConcurrencyStamp
ICreationAuditedObject
IAuditedObject
IFullAuditedObject
IMultiTenant

Extension Methods

AbpObjectExtensions.As<T>(Object)
AbpObjectExtensions.To<T>(Object)
AbpObjectExtensions.IsIn<T>(T, T[])
AbpObjectExtensions.If<T>(T, Boolean, Func<T, T>)
AbpObjectExtensions.If<T>(T, Boolean, Action<T>)
LockExtensions.Locking(Object, Action)
LockExtensions.Locking<T>(T, Action<T>)
LockExtensions.Locking<TResult>(Object, Func<TResult>)
LockExtensions.Locking<T, TResult>(T, Func<T, TResult>)
Back to top Powered by Volosoft