mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Return back DatabaseBackedStore's query and populate functions
This commit is contained in:
@ -6,12 +6,13 @@ using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.IO.Serialization;
|
||||
using osu.Game.Rulesets;
|
||||
|
||||
namespace osu.Game.Beatmaps
|
||||
{
|
||||
public class BeatmapInfo : IEquatable<BeatmapInfo>, IJsonSerializable
|
||||
public class BeatmapInfo : IEquatable<BeatmapInfo>, IJsonSerializable, IPopulate
|
||||
{
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int ID { get; set; }
|
||||
@ -124,5 +125,11 @@ namespace osu.Game.Beatmaps
|
||||
public bool BackgroundEquals(BeatmapInfo other) => other != null && BeatmapSet != null && other.BeatmapSet != null &&
|
||||
BeatmapSet.Hash == other.BeatmapSet.Hash &&
|
||||
(Metadata ?? BeatmapSet.Metadata).BackgroundFile == (other.Metadata ?? other.BeatmapSet.Metadata).BackgroundFile;
|
||||
|
||||
public void Populate(OsuDbContext connection)
|
||||
{
|
||||
var entry = connection.Entry(this);
|
||||
entry.Reference<BeatmapDifficulty>(nameof(Difficulty));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user