Skip to content

Commit

Permalink
fix Bug 70016
Browse files Browse the repository at this point in the history
  • Loading branch information
MaksimChegulov committed Sep 3, 2024
1 parent 8d5ef16 commit cff9c5b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions products/ASC.Files/Core/Core/Dao/TeamlabDao/TagDao.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ await strategy.ExecuteAsync(async () =>
continue;
}
var id = await internalFilesDbContext.TagIdAsync(t.Owner, t.Name, t.Type);
var id = await internalFilesDbContext.TagIdAsync(t.Owner, t.Name, t.Type, tenantId);
var toAdd = new DbFilesTag
{
Expand Down Expand Up @@ -312,7 +312,7 @@ private async Task<Tag> SaveTagAsync(FilesDbContext filesDbContext, int tenantId

if (!cacheTagId.TryGetValue(cacheTagIdKey, out var id))
{
id = await filesDbContext.TagIdAsync(t.Owner, t.Name, t.Type);
id = await filesDbContext.TagIdAsync(t.Owner, t.Name, t.Type, tenantId);

if (id == 0)
{
Expand Down
11 changes: 6 additions & 5 deletions products/ASC.Files/Core/Core/EF/Queries/TagQueries.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,10 @@ public Task<int> DeleteTagAsync()
return TagQueries.DeleteTagAsync(this);
}

[PreCompileQuery([PreCompileQuery.DefaultGuid, null, TagType.Custom])]
public Task<int> TagIdAsync(Guid owner, string name, TagType type)
[PreCompileQuery([PreCompileQuery.DefaultGuid, null, TagType.Custom, PreCompileQuery.DefaultInt])]
public Task<int> TagIdAsync(Guid owner, string name, TagType type, int tenantId)
{
return TagQueries.TagIdAsync(this, owner, name, type);
return TagQueries.TagIdAsync(this, owner, name, type, tenantId);
}

[PreCompileQuery([PreCompileQuery.DefaultInt, PreCompileQuery.DefaultInt, FileEntryType.File, null, PreCompileQuery.DefaultGuid, PreCompileQuery.DefaultDateTime, PreCompileQuery.DefaultInt])]
Expand Down Expand Up @@ -486,10 +486,11 @@ static file class TagQueries
where ftl == null
select ft).ExecuteDelete());

public static readonly Func<FilesDbContext, Guid, string, TagType, Task<int>> TagIdAsync =
public static readonly Func<FilesDbContext, Guid, string, TagType, int, Task<int>> TagIdAsync =
Microsoft.EntityFrameworkCore.EF.CompileAsyncQuery(
(FilesDbContext ctx, Guid owner, string name, TagType type) =>
(FilesDbContext ctx, Guid owner, string name, TagType type, int tenantId) =>
ctx.Tag
.Where(r => r.TenantId == tenantId)
.Where(r => r.Owner == owner)
.Where(r => r.Name == name)
.Where(r => r.Type == type)
Expand Down

0 comments on commit cff9c5b

Please sign in to comment.