From b20e82242705d360ca64c9de3820346112fa3ca9 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Tue, 18 Apr 2023 22:06:44 +0100 Subject: [PATCH] ignore current source setting, at serialisation --- src/isn/Settings.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/isn/Settings.cs b/src/isn/Settings.cs index e1c832d..7756c94 100644 --- a/src/isn/Settings.cs +++ b/src/isn/Settings.cs @@ -1,6 +1,8 @@ using System; using System.Collections.Generic; +using System.ComponentModel.DataAnnotations.Schema; using System.Linq; +using Newtonsoft.Json; namespace isn { @@ -64,13 +66,15 @@ namespace isn string currentSourceKey; + [JsonIgnore, NotMapped] public string CurrentSourceKey { get { return currentSourceKey; } set{ - if (!Sources.ContainsKey(value)) throw new InvalidOperationException($"source is invalid ({value})"); + if (!Sources.ContainsKey(value)) + throw new InvalidOperationException($"source is invalid ({value})"); currentSourceKey = value; } }