Browse Source
Merge pull request #6867 from abpframework/cms-kit/tag-repository
CmsKit - Convert Tag Mongo Query to LINQ
pull/6885/head
İlkay İlknur
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
5 additions and
6 deletions
-
modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Tags/MongoTagRepository.cs
|
|
|
@ -69,12 +69,11 @@ namespace Volo.CmsKit.MongoDB.Tags |
|
|
|
.Select(q => q.TagId) |
|
|
|
.ToListAsync(cancellationToken: GetCancellationToken(cancellationToken)); |
|
|
|
|
|
|
|
var query = await Collection.FindAsync(Builders<Tag>.Filter.And(new[] |
|
|
|
{ |
|
|
|
Builders<Tag>.Filter.Eq(x =>x.EntityType, entityType), |
|
|
|
Builders<Tag>.Filter.Eq(x =>x.TenantId, tenantId), |
|
|
|
Builders<Tag>.Filter.In(x => x.Id, entityTagIds), |
|
|
|
})); |
|
|
|
var query = GetMongoQueryable() |
|
|
|
.Where(x => |
|
|
|
x.EntityType == entityType && |
|
|
|
x.TenantId == tenantId && |
|
|
|
entityTagIds.Contains(x.Id)); |
|
|
|
|
|
|
|
var result = await query.ToListAsync(cancellationToken: GetCancellationToken(cancellationToken)); |
|
|
|
return result; |
|
|
|
|