Merge pull request #9713 from abpframework/auto-merge/rel-4-4/505

Merge branch dev with rel-4.4
pull/9717/head
maliming 4 years ago committed by GitHub
commit 7bffe3a3e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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,

Loading…
Cancel
Save