Browse Source
Merge pull request #9713 from abpframework/auto-merge/rel-4-4/505
Merge branch dev with rel-4.4
pull/9717/head
maliming
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
26 additions and
1 deletions
-
modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/IDocumentRepository.cs
-
modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/Documents/EFCoreDocumentRepository.cs
-
modules/docs/src/Volo.Docs.MongoDB/Volo/Docs/Documents/MongoDocumentRepository.cs
|
|
|
@ -25,6 +25,12 @@ namespace Volo.Docs.Documents |
|
|
|
string version, |
|
|
|
CancellationToken cancellationToken = default); |
|
|
|
|
|
|
|
Task<List<Document>> GetListAsync( |
|
|
|
Guid? projectId, |
|
|
|
string version, |
|
|
|
string name, |
|
|
|
CancellationToken cancellationToken = default); |
|
|
|
|
|
|
|
Task<List<DocumentWithoutContent>> GetAllAsync( |
|
|
|
Guid? projectId, |
|
|
|
string name, |
|
|
|
@ -67,4 +73,4 @@ namespace Volo.Docs.Documents |
|
|
|
|
|
|
|
Task<Document> GetAsync(Guid id, CancellationToken cancellationToken = default); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -38,6 +38,15 @@ namespace Volo.Docs.Documents |
|
|
|
return await (await GetDbSetAsync()).Where(d => d.ProjectId == projectId).ToListAsync(cancellationToken: cancellationToken); |
|
|
|
} |
|
|
|
|
|
|
|
public async Task<List<Document>> GetListAsync(Guid? projectId, string version, string name, CancellationToken cancellationToken = default) |
|
|
|
{ |
|
|
|
return await (await GetDbSetAsync()) |
|
|
|
.WhereIf(version != null, x => x.Version == version) |
|
|
|
.WhereIf(name != null, x => x.Name == name) |
|
|
|
.WhereIf(projectId.HasValue, x => x.ProjectId == projectId) |
|
|
|
.ToListAsync(cancellationToken: cancellationToken); |
|
|
|
} |
|
|
|
|
|
|
|
public async Task<List<DocumentWithoutContent>> GetAllAsync( |
|
|
|
Guid? projectId, |
|
|
|
string name, |
|
|
|
|
|
|
|
@ -57,6 +57,16 @@ namespace Volo.Docs.Documents |
|
|
|
x.Version == version, cancellationToken: cancellationToken); |
|
|
|
} |
|
|
|
|
|
|
|
public async Task<List<Document>> GetListAsync(Guid? projectId, string version, string name, CancellationToken cancellationToken = default) |
|
|
|
{ |
|
|
|
return await (await GetMongoQueryableAsync(cancellationToken)) |
|
|
|
.WhereIf(version != null, x => x.Version == version) |
|
|
|
.WhereIf(name != null, x => x.Name == name) |
|
|
|
.WhereIf(projectId.HasValue, x => x.ProjectId == projectId) |
|
|
|
.As<IMongoQueryable<Document>>() |
|
|
|
.ToListAsync(cancellationToken); |
|
|
|
} |
|
|
|
|
|
|
|
public async Task<List<DocumentWithoutContent>> GetAllAsync( |
|
|
|
Guid? projectId, |
|
|
|
string name, |
|
|
|
|