using System.ComponentModel.DataAnnotations; using DataModel.Database.Common; namespace DataModel.Database; public sealed class TextElement { [Key] public int Id { get; set; } public Guid UniqueId { get; set; } public string Name { get; set; } = string.Empty; public string Code { get; set; } = string.Empty; public bool IsMultiLine { get; set; } = false; public Section Section { get; set; } public List Translations { get; set; } = new(); internal DataContext.JsonUniqueId JsonUniqueId => new(this.Code, this.UniqueId, "TXT"); internal DataContext.JsonTextElement ToJsonTextElement() => new() { UniqueId = this.JsonUniqueId, Code = this.Code, Name = this.Name, IsMultiLine = this.IsMultiLine, SectionUniqueId = this.Section.JsonUniqueId, Translations = this.Translations.Select(n => n.JsonUniqueId).ToList(), }; }