public OrganizationUnitAppService(
     OrganizationUnitManager organizationUnitManager,
     IRepository<OrganizationUnit, long> organizationUnitRepository,
     IRepository<UserOrganizationUnit, long> userOrganizationUnitRepository)
 {
     _organizationUnitManager = organizationUnitManager;
     _organizationUnitRepository = organizationUnitRepository;
     _userOrganizationUnitRepository = userOrganizationUnitRepository;
 }
 public TenantDemoDataBuilder(
     OrganizationUnitManager organizationUnitManager,
     UserManager userManager,
     RandomUserGenerator randomUserGenerator,
     IBinaryObjectManager binaryObjectManager, 
     IAppFolders appFolders)
 {
     _organizationUnitManager = organizationUnitManager;
     _userManager = userManager;
     _randomUserGenerator = randomUserGenerator;
     _binaryObjectManager = binaryObjectManager;
     _appFolders = appFolders;
 }
 public static string GetCode(this OrganizationUnitManager manager, long id)
 {
     return(AsyncHelper.RunSync(() => manager.GetCodeAsync(id)));
 }
 public static List <OrganizationUnit> FindChildren(this OrganizationUnitManager manager, long?parentId, bool recursive = false)
 {
     return(AsyncHelper.RunSync(() => manager.FindChildrenAsync(parentId, recursive)));
 }
 public static void Move(this OrganizationUnitManager manager, long id, long?parentId)
 {
     AsyncHelper.RunSync(() => manager.MoveAsync(id, parentId));
 }
 public static OrganizationUnit GetLastChildOrNull(this OrganizationUnitManager manager, long?parentId)
 {
     return(AsyncHelper.RunSync(() => manager.GetLastChildOrNullAsync(parentId)));
 }
 public static string GetNextChildCode(this OrganizationUnitManager manager, long?parentId)
 {
     return(AsyncHelper.RunSync(() => manager.GetNextChildCodeAsync(parentId)));
 }
 public static void Delete(this OrganizationUnitManager manager, long id)
 {
     AsyncHelper.RunSync(() => manager.DeleteAsync(id));
 }
 public static void Update(this OrganizationUnitManager manager, OrganizationUnit organizationUnit)
 {
     AsyncHelper.RunSync(() => manager.UpdateAsync(organizationUnit));
 }
        public OrganizationUnitManager_Tests()
        {
            AbpSession.TenantId = GetDefaultTenant().Id;

            _organizationUnitManager = Resolve<OrganizationUnitManager>();
        }