1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-12 09:12:54 +08:00

Add helper setter to EF RulesetInfo.OnlineID to allow updating usages

This commit is contained in:
Dean Herbert 2021-11-24 15:23:05 +09:00
parent db2d8b6d8b
commit e57c343531

View File

@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.
using System;
using System.ComponentModel.DataAnnotations.Schema;
using System.Diagnostics.CodeAnalysis;
using Newtonsoft.Json;
using osu.Framework.Testing;
@ -65,7 +66,12 @@ namespace osu.Game.Rulesets
#region Implementation of IHasOnlineID
public int OnlineID => ID ?? -1;
[NotMapped]
public int OnlineID
{
get => ID ?? -1;
set => ID = value >= 0 ? value : (int?)null;
}
#endregion
}