maliming
3 years ago
No known key found for this signature in database
GPG Key ID: A646B9CB645ECEA4
3 changed files with
9 additions and
4 deletions
-
modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EfCoreOrganizationUnitRepository.cs
-
modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoOrganizationUnitRepository.cs
-
modules/identity/test/Volo.Abp.Identity.TestBase/Volo/Abp/Identity/OrganizationUnitRepository_Tests.cs
|
|
|
@ -40,7 +40,7 @@ public class EfCoreOrganizationUnitRepository |
|
|
|
{ |
|
|
|
return await (await GetDbSetAsync()) |
|
|
|
.IncludeDetails(includeDetails) |
|
|
|
.Where(ou => ou.Code.StartsWith(code) && ou.Id != parentId.Value) |
|
|
|
.Where(ou => ou.Code.StartsWith(code) && ou.Id != parentId) |
|
|
|
.ToListAsync(GetCancellationToken(cancellationToken)); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -39,7 +39,7 @@ public class MongoOrganizationUnitRepository |
|
|
|
CancellationToken cancellationToken = default) |
|
|
|
{ |
|
|
|
return await (await GetMongoQueryableAsync(cancellationToken)) |
|
|
|
.Where(ou => ou.Code.StartsWith(code) && ou.Id != parentId.Value) |
|
|
|
.Where(ou => ou.Code.StartsWith(code) && ou.Id != parentId) |
|
|
|
.ToListAsync(GetCancellationToken(cancellationToken)); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -47,8 +47,13 @@ public abstract class OrganizationUnitRepository_Tests<TStartupModule> : AbpIden |
|
|
|
[Fact] |
|
|
|
public async Task GetAllChildrenWithParentCodeAsync() |
|
|
|
{ |
|
|
|
(await _organizationUnitRepository.GetAllChildrenWithParentCodeAsync(OrganizationUnit.CreateCode(0), |
|
|
|
_guidGenerator.Create())).ShouldNotBeNull(); |
|
|
|
var allChildren = await _organizationUnitRepository.GetAllChildrenWithParentCodeAsync(OrganizationUnit.CreateCode(0), _guidGenerator.Create()); |
|
|
|
allChildren.ShouldNotBeNull(); |
|
|
|
allChildren.ShouldBeEmpty(); |
|
|
|
|
|
|
|
allChildren = (await _organizationUnitRepository.GetAllChildrenWithParentCodeAsync(OrganizationUnit.CreateCode(1), null)); |
|
|
|
allChildren.ShouldNotBeNull(); |
|
|
|
allChildren.ShouldNotBeEmpty(); |
|
|
|
} |
|
|
|
|
|
|
|
[Fact] |
|
|
|
|