mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 08:20:00 +09:00
Add RealmLive
implementation
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using AutoMapper;
|
||||
using osu.Game.Input.Bindings;
|
||||
using Realms;
|
||||
@ -47,5 +48,17 @@ namespace osu.Game.Database
|
||||
|
||||
return mapper.Map<T>(item);
|
||||
}
|
||||
|
||||
public static List<RealmLive<T>> ToLive<T>(this IEnumerable<T> realmList)
|
||||
where T : RealmObject, IHasGuidPrimaryKey
|
||||
{
|
||||
return realmList.Select(l => new RealmLive<T>(l)).ToList();
|
||||
}
|
||||
|
||||
public static RealmLive<T> ToLive<T>(this T realmObject)
|
||||
where T : RealmObject, IHasGuidPrimaryKey
|
||||
{
|
||||
return new RealmLive<T>(realmObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user