Return ILive from ToLive calls instead of realm-typed instance

This commit is contained in:
Dean Herbert 2021-11-26 14:40:09 +09:00
parent bb6f8bd59c
commit 21e8ab8357

View File

@ -49,13 +49,13 @@ namespace osu.Game.Database
return mapper.Map<T>(item); return mapper.Map<T>(item);
} }
public static List<RealmLive<T>> ToLive<T>(this IEnumerable<T> realmList) public static List<ILive<T>> ToLive<T>(this IEnumerable<T> realmList)
where T : RealmObject, IHasGuidPrimaryKey where T : RealmObject, IHasGuidPrimaryKey
{ {
return realmList.Select(l => new RealmLive<T>(l)).ToList(); return realmList.Select(l => new RealmLive<T>(l)).Cast<ILive<T>>().ToList();
} }
public static RealmLive<T> ToLive<T>(this T realmObject) public static ILive<T> ToLive<T>(this T realmObject)
where T : RealmObject, IHasGuidPrimaryKey where T : RealmObject, IHasGuidPrimaryKey
{ {
return new RealmLive<T>(realmObject); return new RealmLive<T>(realmObject);