Share file lookup workaround in ArchiveModelManager with workaround extensions class

This commit is contained in:
Dean Herbert
2021-03-15 13:26:14 +09:00
parent 79d3379f55
commit 2904f479c6
2 changed files with 15 additions and 12 deletions

View File

@ -462,9 +462,7 @@ namespace osu.Game.Database
// Dereference the existing file info, since the file model will be removed.
if (file.FileInfo != null)
{
// Workaround System.InvalidOperationException
// The instance of entity type 'FileInfo' cannot be tracked because another instance with the same key value for {'ID'} is already being tracked.
file.FileInfo = usage.Context.FileInfo.Find(file.FileInfoID);
file.Requery(usage.Context);
Files.Dereference(file.FileInfo);