Browse Source

Call directly FirstOrDefaultAsync

pull/20056/head
enisn 2 years ago
parent
commit
413f5bc85f
  1. 6
      modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/MarkedItems/EfCoreUserMarkedItemRepository.cs

6
modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/MarkedItems/EfCoreUserMarkedItemRepository.cs

@ -24,11 +24,11 @@ public class EfCoreUserMarkedItemRepository : EfCoreRepository<ICmsKitDbContext,
Check.NotNull(entityId, nameof(entityId));
var entity = await(await GetDbSetAsync())
.Where(x =>
.FirstOrDefaultAsync(x =>
x.CreatorId == userId &&
x.EntityType == entityType &&
x.EntityId == entityId)
.FirstOrDefaultAsync(GetCancellationToken(cancellationToken));
x.EntityId == entityId,
GetCancellationToken(cancellationToken));
return entity;
}

Loading…
Cancel
Save