mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 18:32:56 +08:00
6db3c32dd1
This may not be the cleanest solution, but there don't seem to be any way towards this either. - `UseDestinationValue` has been inherited by default as noted in https://docs.automapper.org/en/stable/10.0-Upgrade-Guide.html#usedestinationvalue-is-now-inherited-by-default, and its behaviour in this case would be using the nested **managed** realm object for the destination member rather than creating an unmanaged version. - `MaxDepth` already sets `PreserveReferences` so there's no point of using it. - `MaxDepth` should probably not be set for all maps, only for those with cyclic references, to avoid the expensive overhead of `PreserveReferences`, as mentioned in https://docs.automapper.org/en/stable/5.0-Upgrade-Guide.html#circular-references. That aside, `MaxDepth` should actually only be set to `1` for `BeatmapSetInfo` mapping, because we don't want AutoMapper to create a nested instance of `BeatmapSetInfo` in each mapped/detached beatmap, but for some reason, doing that will cause automapper to not map any beatmap inside the set and leave it with 0 beatmaps. While on the other hand, using `MaxDepth(2)` for `BeatmapSetInfo` works, but creates an unused instance of a `BeatmapSetInfo` inside each mapped beatmap, which may not be ideal. For `BeatmapInfo`, it has to be `MaxDepth(2)`, in which the first `BeatmapInfo` depth would be itself (when detaching a beatmap), and the second would be nested beatmaps inside the mapped/detached `BeatmapSetInfo` within the beatmap. (note that when detaching a beatmap set, the unused instance of `BeatmapSetInfo` within each beatmap of that beatmap set doesn't also have a list of unused beatmaps as one might expect from the depth specification, it surprisingly has 0 beatmaps) This causes it to create an unused instance of `BeatmapInfo` in the beatmap set resembling the root mapped/detached beatmap, but that one might be inevitable. |
||
---|---|---|
.. | ||
BeatmapLookupCache.cs | ||
DatabaseContextFactory.cs | ||
DatabaseWriteUsage.cs | ||
EFToRealmMigrator.cs | ||
EntityFrameworkLive.cs | ||
EntityFrameworkLiveExtensions.cs | ||
ICanAcceptFiles.cs | ||
IDatabaseContextFactory.cs | ||
IHasFiles.cs | ||
IHasGuidPrimaryKey.cs | ||
IHasNamedFiles.cs | ||
IHasOnlineID.cs | ||
IHasPrimaryKey.cs | ||
IHasRealmFiles.cs | ||
ILive.cs | ||
IModelDownloader.cs | ||
IModelFileManager.cs | ||
IModelImporter.cs | ||
IModelManager.cs | ||
ImportProgressNotification.cs | ||
ImportTask.cs | ||
INamedFile.cs | ||
INamedFileInfo.cs | ||
INamedFileUsage.cs | ||
IPostImports.cs | ||
IPostNotifications.cs | ||
IRealmFactory.cs | ||
ISoftDelete.cs | ||
LegacyBeatmapExporter.cs | ||
LegacyBeatmapImporter.cs | ||
LegacyExporter.cs | ||
LegacyImportManager.cs | ||
LegacyModelImporter.cs | ||
LegacyScoreExporter.cs | ||
LegacyScoreImporter.cs | ||
LegacySkinExporter.cs | ||
LegacySkinImporter.cs | ||
MemoryCachingComponent.cs | ||
ModelDownloader.cs | ||
OnlineLookupCache.cs | ||
OsuDbContext.cs | ||
RealmContextFactory.cs | ||
RealmExtensions.cs | ||
RealmLive.cs | ||
RealmLiveUnmanaged.cs | ||
RealmObjectExtensions.cs | ||
UserLookupCache.cs |