Esempio n. 1
0
        public virtual async Task DeleteAsync(long id)
        {
            var children = await FindChildrenAsync(id, true);

            foreach (var child in children)
            {
                await OrganizationUnitRepository.DeleteAsync(child);
            }

            await OrganizationUnitRepository.DeleteAsync(id);
        }
Esempio n. 2
0
        public virtual async Task DeleteAsync(long id)
        {
            using (var uow = UnitOfWorkManager.Begin())
            {
                var children = await FindChildrenAsync(id, true);

                foreach (var child in children)
                {
                    await OrganizationUnitRepository.DeleteAsync(child);
                }

                await OrganizationUnitRepository.DeleteAsync(id);

                await uow.CompleteAsync();
            }
        }
Esempio n. 3
0
        public virtual async Task DeleteAsync(Guid id)
        {
            var children = await FindChildrenAsync(id, true);

            foreach (var child in children)
            {
                await OrganizationUnitRepository.RemoveAllMembersAsync(child);

                await OrganizationUnitRepository.RemoveAllRolesAsync(child);

                await OrganizationUnitRepository.DeleteAsync(child);
            }

            var organizationUnit = await OrganizationUnitRepository.GetAsync(id);

            await OrganizationUnitRepository.RemoveAllMembersAsync(organizationUnit);

            await OrganizationUnitRepository.RemoveAllRolesAsync(organizationUnit);

            await OrganizationUnitRepository.DeleteAsync(id);
        }