2021-01-07 13:07:36 +08:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
|
|
|
using System;
|
|
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
using Newtonsoft.Json;
|
2021-01-07 14:41:58 +08:00
|
|
|
using Realms;
|
2021-01-07 13:07:36 +08:00
|
|
|
|
|
|
|
namespace osu.Game.Database
|
|
|
|
{
|
|
|
|
public interface IHasGuidPrimaryKey
|
|
|
|
{
|
2021-01-07 14:41:58 +08:00
|
|
|
[JsonIgnore]
|
|
|
|
[Ignored]
|
|
|
|
public Guid Guid
|
|
|
|
{
|
|
|
|
get => new Guid(ID);
|
|
|
|
set => ID = value.ToString();
|
|
|
|
}
|
|
|
|
|
2021-01-07 13:07:36 +08:00
|
|
|
[JsonIgnore]
|
|
|
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
2021-01-08 14:49:11 +08:00
|
|
|
[PrimaryKey]
|
2021-01-07 14:41:58 +08:00
|
|
|
string ID { get; set; }
|
2021-01-07 13:07:36 +08:00
|
|
|
}
|
|
|
|
}
|