From 21e8ab835769c5be5c66f16b241bdf6cb774b848 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 26 Nov 2021 14:40:09 +0900 Subject: [PATCH] Return `ILive` from `ToLive` calls instead of realm-typed instance --- osu.Game/Database/RealmObjectExtensions.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Database/RealmObjectExtensions.cs b/osu.Game/Database/RealmObjectExtensions.cs index 18a926fa8c..ac4ca436ad 100644 --- a/osu.Game/Database/RealmObjectExtensions.cs +++ b/osu.Game/Database/RealmObjectExtensions.cs @@ -49,13 +49,13 @@ public static T Detach(this T item) where T : RealmObject return mapper.Map(item); } - public static List> ToLive(this IEnumerable realmList) + public static List> ToLive(this IEnumerable realmList) where T : RealmObject, IHasGuidPrimaryKey { - return realmList.Select(l => new RealmLive(l)).ToList(); + return realmList.Select(l => new RealmLive(l)).Cast>().ToList(); } - public static RealmLive ToLive(this T realmObject) + public static ILive ToLive(this T realmObject) where T : RealmObject, IHasGuidPrimaryKey { return new RealmLive(realmObject);