0
soonjoo created
Hello, i have issue where the deleted entities are still being queried out. This is my code:
var fileWithAdditionalInfo = await _fileRepository
.GetAll()
.Include(e => e.FilePermissions)
.ThenInclude(filePermission => filePermission.SharedWithUser)
.Include(e => e.FileAnnotations)
.ThenInclude(fileAnnotation => fileAnnotation.Annotation)
.Where(e => e.Id == file.Id)
.FirstOrDefaultAsync();
And this is my local variable while im debugging.
Currently my FilePermission inherits my own class which is PermissionBase, and PermissionBase inherits FullAuditedEntity.
Am I missing something or is this a bug on your side? thank you
2 Answer(s)
-
0
The issue is still there, but for now, I will use a quick fix, this is my code that works temporarily now:
var fileWithAdditionalInfo = await _fileRepository .GetAll() .Include(e => e.FileAnnotations) .ThenInclude(fileAnnotation => fileAnnotation.Annotation) .Where(e => e.Id == file.Id) .FirstOrDefaultAsync(); var filePermissions = await _filePermissionRepository .GetAll() .Where(e => e.FileId == fileId) .ToListAsync(); fileWithAdditionalInfo.FilePermissions = filePermissions;
-
0
Hi @soonjoo,
I think you are using EntityFramework Core. Query filters are not supported in EF Core yet. We make a workaround for this but it only filters main queries and not Includes.
Thanks.