using System.ComponentModel.DataAnnotations; using Waaagh.Helpers; namespace Waaagh.Models { public class Message: IUpdateReferences { [Key] public int Key { get; set; } public short Channel { get; set; } = 0x0000; public bool Reply { get; set; } = false; public string Name { get; set; } = string.Empty; private string content = string.Empty; public string Content { get => content; set { content = value; // Value = SECSValue.Parse(content); //if (Value == null) { // throw new ArgumentException($"{nameof(Message)}: Content Parsing Failed."); //} } } #region Serialize Ignore public int Stream => (Channel >> 8) & 0xff; public int Function => (Channel >> 0) & 0xff; //public SECSValue? Value { get; private set; } = default; #endregion public void UpdateReferences(Message value) { Message message = this; ModelUpdateHelper.UpdateWritableProperies(ref message, value); } } }