2022-06-12 15:15:09 +00:00
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
2022-11-14 19:32:41 +00:00
|
|
|
|
using DataModel.Database.Common;
|
2022-06-12 15:15:09 +00:00
|
|
|
|
|
|
|
|
|
namespace DataModel.Database;
|
|
|
|
|
|
2022-06-12 19:42:47 +00:00
|
|
|
|
public sealed class Setting
|
2022-06-12 15:15:09 +00:00
|
|
|
|
{
|
|
|
|
|
[Key]
|
|
|
|
|
public int Id { get; set; }
|
|
|
|
|
|
2022-11-06 20:07:41 +00:00
|
|
|
|
public Guid UniqueId { get; set; }
|
|
|
|
|
|
2022-07-25 17:03:49 +00:00
|
|
|
|
public string Code { get; set; } = string.Empty;
|
2022-06-12 15:15:09 +00:00
|
|
|
|
|
|
|
|
|
public string TextValue { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
|
|
public bool BoolValue { get; set; }
|
|
|
|
|
|
|
|
|
|
public int IntegerValue { get; set; }
|
|
|
|
|
|
|
|
|
|
public Guid GuidValue { get; set; }
|
2022-11-14 19:32:41 +00:00
|
|
|
|
|
|
|
|
|
internal DataContext.JsonUniqueId JsonUniqueId => new(this.Code, this.UniqueId, "Set");
|
|
|
|
|
|
|
|
|
|
internal DataContext.JsonSetting ToJsonSetting() => new()
|
|
|
|
|
{
|
|
|
|
|
UniqueId = this.JsonUniqueId,
|
|
|
|
|
Code = this.Code,
|
|
|
|
|
BoolValue = this.BoolValue,
|
|
|
|
|
GuidValue = this.GuidValue,
|
|
|
|
|
IntegerValue = this.IntegerValue,
|
|
|
|
|
TextValue = this.TextValue,
|
|
|
|
|
};
|
2022-06-12 15:15:09 +00:00
|
|
|
|
}
|