using System.ComponentModel.DataAnnotations; using DataModel.Database.Common; namespace DataModel.Database; public sealed class Setting { [Key] public int Id { get; set; } public Guid UniqueId { get; set; } public string Code { get; set; } = string.Empty; public string TextValue { get; set; } = string.Empty; public bool BoolValue { get; set; } public int IntegerValue { get; set; } public Guid GuidValue { get; set; } 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, }; }