Files: fix cast

This commit is contained in:
Maksim Chegulov 2022-08-31 13:02:22 +03:00
parent 9e949d52ad
commit f8a2b8caef
2 changed files with 11 additions and 11 deletions

View File

@ -31,7 +31,7 @@ namespace ASC.Files.Service.Core;
public class FilesModule : FeedModule
{
public override Guid ProductID => WebItemManager.DocumentsProductID;
public override string Name => Feed.Constants.FilesModule;
public override string Name => Constants.FilesModule;
public override string Product => "documents";
protected override string DbId => "files";
@ -67,9 +67,9 @@ public class FilesModule : FeedModule
return false;
}
var tuple = ((File<int>, SmallShareRecord))data;
var file = tuple.Item1;
var shareRecord = tuple.Item2;
var fileWithShare = (FileWithShare)data;
var file = fileWithShare.File;
var shareRecord = fileWithShare.ShareRecord;
bool targetCond;
if (feed.Target != null)
@ -105,9 +105,9 @@ public class FilesModule : FeedModule
var feed1 = feed.Select(r =>
{
var tuple = ((File<int>, SmallShareRecord))r.Item2;
var fileWithShare = (FileWithShare)r.Item2;
return new Tuple<FeedRow, File<int>, SmallShareRecord>(r.Item1, tuple.Item1, tuple.Item2);
return new Tuple<FeedRow, File<int>, SmallShareRecord>(r.Item1, fileWithShare.File, fileWithShare.ShareRecord);
})
.ToList();

View File

@ -31,9 +31,9 @@ namespace ASC.Files.Service.Core;
public class FoldersModule : FeedModule
{
public override Guid ProductID => WebItemManager.DocumentsProductID;
public override string Name => Feed.Constants.FoldersModule;
public override string Name => Constants.FoldersModule;
public override string Product => "documents";
protected override string DbId => Feed.Constants.FilesDbId;
protected override string DbId => Constants.FilesDbId;
private const string FolderItem = "folder";
private const string SharedFolderItem = "sharedFolder";
@ -65,9 +65,9 @@ public class FoldersModule : FeedModule
return false;
}
var tuple = (Tuple<Folder<int>, SmallShareRecord>)data;
var folder = tuple.Item1;
var shareRecord = tuple.Item2;
var folderWithShare = (FolderWithShare)data;
var folder = folderWithShare.Folder;
var shareRecord = folderWithShare.ShareRecord;
bool targetCond;
if (feed.Target != null)